Monday, 15 June 2015

ruby - Variable in View is always nil -



ruby - Variable in View is always nil -

i new ruby. created new action in controller set variable test1

def tsload @test1 = '00:00' respond_to |format| format.html { render :template => 'tsload' } end end

but in view value of variable test1 nil. seems undefined.

<p>test</p> <% if @test1.nil? %> <p>nil</p> <% end %>

i not understand wrong. in older actions in controller works ok. can please help me? line routes.rb

match 'wktime/tsload', :to => 'wktime#tsload', :via => [:get]

ruby variables view controller null

No comments:

Post a Comment