Questions tagged [rails-engines]

A Rails engine allows you to share common functionality across applications in the form of a gem or a plugin. Engines can be considered miniature applications that provide functionality to their host applications.

A Rails engine allows you to share common functionality across applications in the form of a gem or a plugin. Engines can be considered miniature applications that provide functionality to their host applications.

Check http://guides.rubyonrails.org/engines.html and http://railscasts.com/episodes/277-mountable-engines for more details.

776 questions
0
votes
1 answer

How did Devise make it mountable inside another engine?

I am building an engine with the vision that it can be mounted inside another engine, similarly to how devise can be mounted in an engine. https://github.com/plataformatec/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine I was wondering…
Karan
  • 14,824
  • 24
  • 91
  • 157
0
votes
1 answer

Rails: Reference an engine from an engine

I have a higher level app, that includes two engines: Core (engine) API (engine) The API engine depends on the models present in the Core engine. I was wondering how to reference these. What I have tried For example, if the Core engine has the…
Karan
  • 14,824
  • 24
  • 91
  • 157
0
votes
1 answer

ActiveAdmin resource for a namespaced resource

I am using ActiveAdmin for the first time. I am trying to create an administration page for a model that lives under my "Core" engine. I hence have defined a active_admin file as follows: ActiveAdmin.register Core::Property do end This creates a…
Karan
  • 14,824
  • 24
  • 91
  • 157
0
votes
0 answers

Rspec: adding before to all tests

Based on this stackoverflow q, adding the following line solves the same problem faced that is explained in the question: before(:each) { @routes = MyEngine::Engine.routes } The last part of the thread explains that I do not have to add that line…
Karan
  • 14,824
  • 24
  • 91
  • 157
0
votes
0 answers

Benefits of Rails namespaced isolated Engine?

I have 2 Rails applications mounting a Core Engine. The Engine is used here to group common code between Rails applications (they have very similar business logic but views and some other things differ). The Core::Engine holds: common models common…
0
votes
2 answers

Devise not working with Rails 4.0

I took the following steps: rails new routing_test in Gemfile I added devise rails devise g user invoke active_record create db/migrate/20130731191051_devise_create_users.rb create app/models/user.rb invoke rspec create …
Karan
  • 14,824
  • 24
  • 91
  • 157
0
votes
2 answers

Ruby on Rails and Rails Engine

Can I access main app's ApplicationController in my rails engine? I want to apply a filter to my app's ApplicationController through an engine. A bit of code will be really helpful. Thanks!
0
votes
2 answers

ruby rails 3.2 rake assets:precompile fails for engine assets

I've created a full engine packaged as a gem that allows me to quickly deploy CSS, images, JS/JQuery items and a working User model that is common to all of my projects. In development mode, it all works smartly. However, trying to precompile the…
MichelV69
  • 1,247
  • 6
  • 18
0
votes
1 answer

Engine's routes not available in host's views

I got an application that I turned into an engine which has tons of routes. I added the engine to a host app via Gemfile and when I run rake routes everything is displayed properly. However, in the views, the routes aren't found resulting in this…
Cojones
  • 2,930
  • 4
  • 29
  • 41
0
votes
1 answer

Rails Engine migrations to a different folder

Reference question Our group works with a common application but we also individually work on Engines. Is there a configuration is Rails 3 that allows us to put Engine-related migrations files on a different folder? The goal is to track our…
RailinginDFW
  • 1,523
  • 12
  • 19
0
votes
1 answer

Rail::Engine using Rails::Application styles

How my Rails Engine when installed on an Rails Application will use the Application stylesheets? Now, when the engine is instaled, they no have styles. I try to override the [engine]/layouts/application to use my "application" stylesheet, but i…
Ronan
  • 127
  • 2
  • 7
0
votes
1 answer

Test Ruby Gem in main application without commiting every change to git

I'm developing a main rails application where I want to mount some rails engines and gems I've developed on my own. Some of my (under development) engines depend on the main Application and the engines I've already mounted into the main app. Now, I…
pmuens
  • 788
  • 6
  • 16
0
votes
2 answers

Ruby on Rails plugin development process

I'm considering developing aspects of a website as Rails plugins for reuse. My question is about the development process. Since each of these plugins will provide a "slice" of functionality, should I develop each "slice" as it's own application…
Phil
  • 271
  • 4
  • 13
0
votes
1 answer

How to test a view partial or helper method for a Rails engine gem using RSpec?

I've spent the last 2 days reading everything I could find on blogs, in books, in other gems' source, and on SO and I can't for the life of me figure this out. Admittedly I'm new to writing Ruby gems, Rails engines, and am not entirely familiar with…
robmclarty
  • 2,215
  • 2
  • 20
  • 21
0
votes
3 answers

Rails 4 Engine not migrating migrations

I created a new rails 4 engine and added a model. I am trying to migrate the database using RAILS_ENV=test rake db:migrate and it comes back with no errors. However, when I run: rspec spec an error returns stating there are pending migrations.…
anthony
  • 391
  • 1
  • 3
  • 15