For example, I want to display <%= @location.country %>
in views to the user. So if the user visits http://domain.com/tutorials/123 , he'll see <%= @location.country %>
. That is, Rails doesn't process that portion.
I'm thinking something along the lines of <*= @location.country %>
, but of course that doesn't work. Any ideas?
你添加第二个%。
<%%= @location.country %>
You need to use html entities for the <
( <
) and >
( >
). So something like <%= @location.country %>
will work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.