Friday, March 8, 2013

[Rails] Rails engines question

I would like to use my own directory named forms inside my own engine. I
know I can add it to loading paths like this in application.rb
module MyAPP
class Application < Rails::Application
config.paths["forms"] = Rails.root.join('vendor/myapp/forms')
end
end
or inside

and can access it inside controller like this:

MyAPP::Application.config["forms"]

Which is a bit of a problem since my engine would have to know
application name inside which it runs. So, my questions are:

1. Is there a better way to access config object?. Like session or
params inside controller.

2. What Rails API method is used to search files for example in
MyAPP::Application.config["views"] paths and returns name of file (view)
if find.

by
TheR

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate