Displaying 6 results from an estimated 6 matches for "my_engine".
2011 Jul 25
3
Rails 3.1 Engines: Full vs. Mountable
...ntable one.
I have noticed the following:
** Full Engine **
- With a full engine, the parent application inherits the routes from
the engine. It is not necessary to specify anything in parent_app/
config/routes.rb. Specifying the gem in Gemfile is enough. The
engine routes are specified as:
# my_engine/config/routes.rb
Rails.application.routes.draw do
# whatever
end
- No namespacing of models, controllers, etc. These are immediately
accessible to the parent application.
** Mountable Engine **
- The engine''s namespace is isolated by default.
# my_engine/lib/my_engine/engine.rb
module...
2011 Jun 04
1
rails 3 engine under dynamic scope
hello,
i have a rails 3 engine scoped dynamically like this:
scope "/:locale" do
mount MyEngine::Engine => '''', :as => ''my_engine''
end
I can''t seem to be able to set my own locale like this:
my_engine.page_path(page, :locale => ''de'')
the path is generated like this:
/en/page/12345?locale=de
instead of simply:
/de/page/12345
Any suggestions how to do this correcly?
Thank you!
--...
2014 Mar 31
0
Rails Engine ActionController::UrlGenerationError on functional tests
...ctionController::UrlGenerationError exception.
Here an example of code with the problem:
# config/routes.rbMyEngine::Engine.routes.draw do
resources :cats, only: [:show], format: 'json'end
# test/dummy/config/routes.rbRails.application.routes.draw do
mount MyEngine::Engine => '/my_engine'end
# app/controllers/my_engine/cats_controller.rbmodule MyEngine
class CatsController < ApplicationController
def show
render json: { hello: 'world' }
end
endend
# test/controllers/my_engine/cats_controller_test.rbmodule MyEngine
class CatsControllerTest < Act...
2006 Jan 12
2
Engines issue: rake test_plugins failing when it shouldn''t
...dbye.''
end
end
Requesting /fred/hello still gives the correct page (as it should),
but now ''rake test_plugins'' fails with:
1) Error:
test_hello(FredControllerTest):
ActionController::UnknownAction: No action responded to hello
...
./vendor/plugins/my_engine/test/functional/
fred_controller_test.rb:16:in `test_hello''
In other words, as soon as I define a controller in the app that is
the same as a controller in the plugin, the engine tests use only the
code from the app and not the code from the plugin. I would have
thought they'...
2006 Nov 04
0
script/generate and --destination
Hi,
I notice looking at the code for the generate script that there it
"recognises" a --destination command line parameter (so I can do ''ruby
script/generate model --destination vendor/plugins/my_engine
my_model'') but it isn''t processed by the command line handling. I''ve
hacked it into my code but I was wondering if this is an up-and-coming
thing or whether I should submit this back as a patch? It''s *really*
simple to patch!
Matt
2012 May 01
0
Engine: access to url_helpers otside view/controller
...ation it simple:
Rails.application.routes.url_helpers.<name>_path
But how to get access to url_helpers in Engine? When I use
Rails.application.routes.url_helpers.root_path, then I get ''/'', root of
Application. Other helpers for Engine aren''t not defined. Also
Rails.my_engine.routes.url_helpers.root_path fails.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.o...