ruby on rails - Query about calling instance variables in view -


i'm calling following in application.html.erb view layout

<%= @time %> 

and what's in application controller:

def time_now @time = time.current end 

yet time not displaying on browser. helps?

thanks

are sure calling method time_now somewhere in your, say, index method?

e.g., try following in application controller (and make sure no 1 overriding method in subclass:

def index   @time = time.current end 

so if config/routes.rb has root 'welcome#index', make sure welcomecontroller not have index method or calling super applicationcontroller#index method called set @time.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -