Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Extending Layouts

rails layout extend

  • Please log in to reply
No replies to this topic

#1 xExekut3x

xExekut3x

    Passenger

  • Members
  • 5 posts

Posted 29 January 2014 - 03:13 AM

This is what I'm trying to figure out how to do:

 

I have my application.html.erb, which all other views extend, but I would like some views to extend the views which extend the application.html.erb.

 

application.html.erb

      > someViewFolder/index.html.erb

      > someViewFolder/layout.html.erb

            > someViewSubFolder/index.html.erb - extends the parent layout.html.erb

 

I don't want to do this with a Gem.

 

I guess I would also need to know how to change my routes.rb or the definition (def) for "someViewFolder" in my "someViewFolder" controller to know to point to the "someViewSubFolder/index.html.erb" file.

 

Anyone have any ideas on how to do this? Could you give me an example?

 

Thanks!







Also tagged with one or more of these keywords: rails, layout, extend

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users