Friday, April 30, 2010

[Rails] undefined method `call' for nil:NilClass

why would I be getting this error after submitting my form?

NoMethodError in EchantillonsController#create
undefined method `call' for nil:NilClass

This is my create method in the controller:

def create

@echantillon = Echantillon.new(params[:echantillon])
@echantillon.set_eros_values

respond_to do |format|
if @echantillon.save
if params[:echantillon][:vignette].blank?
format.html { redirect_to(@echantillon) }
format.xml { render :xml => @echantillon, :status
=> :created, :location => @echantillon }
else
render :action => "location"
end
else
format.html { render :action => "new" }
format.xml { render :xml => @echantillon.errors, :status
=> :unprocessable_entity }
end
end
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate