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

Rails 3.2 Engine weirdness with before_filter

I have a Rails 3.2.6 application which requires you to login to use it. It also has an Rails Engine mounted to /api which provides a JSON API to certain parts, without requiring authentication. When I kick up the Rails server and make the following…
jimeh
  • 1,391
  • 1
  • 16
  • 32
0
votes
1 answer

Cannot see Routes when mounting Rails 3 Engine

I have created a Rails Engine (as per the Rails Guides) using: rails plugin new address_book --full --mountable I proceeded to create a controller for the Engine called pages with a single action (called temp) to display a single view, namely…
0
votes
1 answer

Gem creation and import

I currently am working on a project where I have a main application that has several hosted engines. One of these engines is for the authentication and session handling that is currently stored in the main application in its own root folder. I wish…
Jay
  • 3,012
  • 14
  • 48
  • 99
0
votes
2 answers

Can I run a rake task inside a generator?

I have a simple rails install generator for an engine I'm making: module Bouncer module Generators class InstallGenerator < Rails::Generators::Base source_root File.expand_path("../../templates", __FILE__) desc "Copies locale file…
stephenmurdoch
  • 34,024
  • 29
  • 114
  • 189
-1
votes
1 answer

Restart a dummy application when testing rails engines?

I'm working in a new Rails engine and I need to restart it while testing. Of I try Dummy::Application.initialize! it do not work because the application was already initialized, so Rails returned the same instance. I need to do so my engine…
stJhimy
  • 19
  • 2
-1
votes
1 answer

Rails 4 Engine not loading the Routes from Root app

I have created a new rails 4 Engine and try to work no mount routes for the newly created Engine but it did not worked for me below are the files. app/routes.rb (root routes file) Rails.application.routes.draw do mount Uhoh::Engine => "/uhoh" …
user3906755
  • 103
  • 3
  • 11
-1
votes
2 answers

disable functions like acts_as_x in model

Basically I am using some engines whose model class uses some gems like acts_as_x. To override the model I use class_eval but I don't need acts_as_x functionalities because it makes heavy calculations that I don't need. Is there anyway to disable…
Moh
  • 249
  • 3
  • 15
-1
votes
1 answer

Rails mount engine while allowing to subclass any engine class

I'm building a platform in Rails that will act as a basis for a few other Rails applications. Ideally I would like this to be a shared engine, on which the other concrete applications can build. It would be nice if the applications could extend the…
Rengers
  • 14,911
  • 1
  • 36
  • 54
-1
votes
1 answer

ActiveRecord::ConfigurationError - Association named 'whatever' was not found

I have a complicated case where I'm developing a Rails 3 Engine and I only intermittently get the error in the title. Here's the stacktrace: ActiveRecord::ConfigurationError - Association named 'whatever' was not found; perhaps you misspelled it?: …
-1
votes
2 answers

Gem needs to append column to passed model

I cannot find out how to have my gem append a column to an existing model/table. My gem needs to check the created_at attribute of a model, and based on time passed, set an active column from true to false. I'm assuming that, upon install, it will…
1 2 3
51
52