Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NoMethodError in Photos#create
- Showing app/views/photos/new.html.erb where line #22 raised:
- You have a nil object when you didn't expect it!
- You might have expected an instance of Array.
- The error occurred while evaluating nil.empty?
- Extracted source (around line #22):
- 19: <% route = @thing.nil? ? @photo : [@thing, @photo] %>
- 20: <% form_for route, :html => { :multipart => true } do |f| %>
- 21: <div class="text"><%= f.label "photo", t(:"choose_file") %><%= f.file_field :file %></div>
- 22: <% if @thing.class != Gallery && !@galleries.empty? %>
- 23: <div class="text"><%= f.label "gallery_id" %><%= f.select "gallery_id", @galleries.map { |g| [g.title, g.id] }, :include_blank => true %>
- 24: <% end %>
- 25: <div class="button"><%= submit_tag t(:"upload") %> <%= t :"or" %> <%= link_to t(:"cancel"), :id => "cancel" %></div>
- RAILS_ROOT: /biz/bangsr
- app/views/photos/new.html.erb:22
- app/views/photos/new.html.erb:20
- app/controllers/photos_controller.rb:41:in `create'
Add Comment
Please, Sign In to add comment