开发者

Ruby questions about web layer layout

开发者 https://www.devze.com 2023-03-04 04:03 出处:网络
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 the

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消