Normally rails would automatically render the file corresponding to the controller and action. For example an action index
in TestController
could render the file app/views/test/index.html.erb
. Is there a dynamic way where I can get the path of the corresponding action view file? For example, if I have test#something
I want to get app/views/test/something.html.erb
.
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Strong parameter override for DeviseTokenAuth cont
- Mechanize getting “Errno::ECONNRESET: Connection r
- Eager-loading association count with Arel (Rails 3
相关文章
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
- Factory_girl has_one relation with validates_prese
It is possible. Check out LookupContext and
view_renderer
.Within controller's action:
Within view: