Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

'verb'! do |success, failure| is only for verbs create, update, destroy #146

Merged
merged 1 commit into from

2 participants

@sodabrew
Owner

This is incorrect usage of inherited_resources bang verbs. The index! resource requires a block with one argument. Ruby 1.8 silently ignores this, but Ruby 1.9 gets very upset. Only create!, update!, and destroy! may take blocks with arity 2.

@sodabrew
Owner

For search index posterity, the error this resolves is "uninitialized constant Mime::TO_ARY" (Google that string with quotes, and just one IRC thread about this perplexing error in puppet-dashboard comes up in the search results).

@haus

Finished in 44.058365 seconds

527 examples, 0 failures

@sodabrew sodabrew merged commit dd44529 into sodabrew:master
@sodabrew sodabrew deleted the sodabrew:patch-3 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2012
  1. 'verb'! do |success, failure| is only for verbs create, update, destr…

    authored
    …oy; everything else must use 'verb'! do |format|.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/reports_controller.rb
View
4 app/controllers/reports_controller.rb
@@ -8,8 +8,8 @@ class ReportsController < InheritedResources::Base
attr_accessor :errors
def index
- index! do |success,failure|
- success.html do
+ index! do |format|
+ format.html do
if params[:kind] == "inspect"
@reports = paginate_scope Report.inspections
else
Something went wrong with that request. Please try again.