Rails response的几种方式

1,Rendering Templates
render(:text => string)
render(:inline => string, [:type => "rhtml"|"rxml"])
render(:action => action_name)
render(:file => path, [:use_full_path => true|false])
render(:template => name)
render(:partial => name, ...)
render(:nothing => true)
render()

2,Sending Files and Other Data
send_data(data, options...) Options --:filename, :type, :disposition
send_file(path, options...) Options -- :filename, :type, :disposition, :streaming

3,Redirects
redirect_to(options...) Options -- url_for()
redirect_to(path)
redirect_to(url)

你可能感兴趣的:(Rails)