Ruby questions about web layer layout
I am trying to make a URL like <a href="/formats/formats.html.erb">Link Title</a>
from within my application. What is the file that I need to edit to link this URL to a controller and then a view?
Also, I am still working my wa开发者_开发技巧y through this tutorial:
http://guides.rubyonrails.org/layouts_and_rendering.html
and I am wondering when they do something like this:
<%= stylesheet_link_tag "http://example.com/main.css" %>
is that supposed to live in the application.html.erb
file or the index.html.erb
file?
What is the file that I need to edit to link this url to a controller and then a view?
routes.rb
See the rails guide
is that supposed to live in the application.html.erb file or the index.html.erb file?
The simple answer is: application.html.erb, inside the head section. There are ways of injecting view template stuff into the head, but if you're just starting out, stick with application.html.erb.
精彩评论