Answer the question
In order to leave comments, you need to log in
How to set a method globally?
Hello.
I can't get this line to work on the page /views/applications.html.haml%h1.name #{@user.first_name} #{ @user.last_name}
On the pages users/show.html.haml it works.
How to set a method so that it works everywhere, on all pages?
Answer the question
In order to leave comments, you need to log in
You need to declare the method as a helper.
class ApplicationController < ActionController::Base
helper :show_user
def show_user
#блаблабла
end
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question