What to include in the template structure
render
view
to loadclass DemoController < ...
def index
# will implicitly render the view page located in views/demo/index
# otherwise you can specify which view to render:
# render(:template => 'demo/hello') same as below:
render('demo/hello')
# render the view inside views/demo/hello
# since you are in the demo controller, you don't even need to specify demo:
render('hello')
end
def hello
end
end
redirect_to
Class DemoController < ...
def index
render('hello')
end
def hello
end
def other_hello
redirect_to(:controller => 'demo', :action => 'index')
# if located in same controller:
# redirect_to(:action => "index")
# you can also redirect to an actual website:
redirect_to("http://lynda.com")
end