Answer the question
In order to leave comments, you need to log in
Why is the Meta tag not updated when following links to pages of the same controller?
The situation is as follows:
1) I define a variable in the controller @info = Info.find_by slug: params[:id]
2) I define two methods in the helper:
def title_for_info
if @info.present?
@info.title
else
"Текст"
end
end
def description_for_info
# @info = Info.find_by slug: params[:id]
if @info.present?
@info.description
else
"Текст"
end
end
%meta{:content => "#{description_for_info}",:name => "description"}/
%title= title_for_info
= @info.description
Answer the question
In order to leave comments, you need to log in
In my case, it helped to add to the links on the home page:target => '_self'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question