Class: ProjectsController
Instance Attribute Summary
#formats
Instance Method Summary
collapse
clear_respond_to, inherit_resources, respond_to, #respond_to, #respond_with, #responder
Instance Method Details
#index ⇒ Object
25
26
27
|
# File 'lib/vendor/plugins/inherited_resources/test/respond_to_test.rb', line 25
def index
respond_with(Project.new)
end
|
#respond_to_skip_default_template ⇒ Object
If the user request Mime::ALL and we have a template called action.html.erb, the html template should be rendered unless html is specified inside the block. This tests exactly this case.
48
49
50
51
52
|
# File 'lib/vendor/plugins/inherited_resources/test/respond_to_test.rb', line 48
def respond_to_skip_default_template
respond_with(Project.new) do |format|
format.html { render :text => 'Render HTML' }
end
end
|
#respond_with_resource ⇒ Object
29
30
31
|
# File 'lib/vendor/plugins/inherited_resources/test/respond_to_test.rb', line 29
def respond_with_resource
respond_with(Project.new)
end
|
#respond_with_resource_and_blocks ⇒ Object
37
38
39
40
41
42
|
# File 'lib/vendor/plugins/inherited_resources/test/respond_to_test.rb', line 37
def respond_with_resource_and_blocks
respond_with(Project.new) do |format|
format.json { render :text => 'Render JSON' }
format. { render :text => 'Render RSS' }
end
end
|
#respond_with_resource_and_options ⇒ Object
33
34
35
|
# File 'lib/vendor/plugins/inherited_resources/test/respond_to_test.rb', line 33
def respond_with_resource_and_options
respond_with(Project.new, :location => 'http://test.host/')
end
|