When I define an instance variable in an action, is it not available inside other actions belonging to same controller.
Instance variable should be available throughout the class. Right?
class DemoController < ApplicationController
def index
#render('demo/hello')
#redirect_to(:action => 'other_hello')
end
def hello
#redirect_to('http://www.google.co.in')
@array = [1,2,3,4,5]
@page = params[:page].to_i
end
def other_hello
render(:text => 'Hello Everyone')
end
end
If I define the array in index and access it from hello view then why am I getting errors for false values of nil?