On 2 April 2013 15:34, Jax <javier_rossetti1...@hotmail.com> wrote:
>
> NoMethodError in Locations#new
>
> Showing C:/Postgrads0204/app/views/locations/_form.html.erb where line #1
> raised:
>
> undefined method `model_name' for NilClass:Class
>
> Extracted source (around line #1):
>
> 1: <%= form_for(@location) do |f| %>

The problem is nothing to do with the gem.  @location is nil.  Are you
passing the value across when you render the form?  It seems to be the
only bit of code that you have not shown us.  See
http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
for how to pass data to the form.

Also have a look at the Rails Guide on debugging with will show you
techniques that you can use to debug your code.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to