This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table> | |
| <%= render :partial => 'foo_row', :collection => @foobars %> | |
| </table> | |
| # _foo_row.html.erb | |
| <tr> | |
| <td> | |
| <%= foobar.name %> | |
| </td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/views/layout/application.rb | |
| <html> | |
| <head> | |
| <%= yield :head %> | |
| ... | |
| # app/views/foobars/index.html.erb | |
| <% content_for :head do %> | |
| <script type='text/javascript'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def link_to_with_highlight(name, options = {}, html_options = {}) # same sig as #link_to | |
| html_options.merge!({ :class => 'active' }) if current_page?(options) | |
| link_to(name, options, html_options) | |
| end |
NewerOlder