Rails Render is a strong method that helps you to render your web pages. It comes with many flavors including:
1) Render action: render an action in the current controller, you can specify if you want layout printed or not
render :action => "show_home_page", :layout=> false
2) Render partial: renders part of your web page
render :partial => "footer"
3) Render template: render a page, the file path is relative to your application
render :template=> "templates"
4) Render file: absolute path is needed
render :file => "#{RAILS_ROOT}/public/file.html"
5) Render text
render :text => "This is rails render"
6) Render Json
render :json => {:name => "Ruby"}.to_json
|
My Blog Title
|