Rails 4 nil or empty argument with two forms creating new -


I have two forms to create a new image. I want them to go to both_image_path, but with the @image variable.

gets this error:
  The first argument in the form is zero or below Can not be   

one form:

  & lt;% = form_for @image, url: new_sm_image_path (@image). F | & Gt%;   

Other:

  & lt;% = form_for @image, url: new_lrg_image_path (@image) do | F | & Gt%;   

My route:

  get "/ sm_image": "image # new_sm", like: "new_sm_image", "/ lrg_image", get For: "images # new_lrg", as such: "new_lrg_image"   

My index.html.erb has two buttons:

   & Lt;% = link_to 'lrg_image', id: "new_button"%>    

set the example variable @image in your controller's action Are rendering these forms are currently @image is zero, therefore you get an error because the first argument in the form can not be included in the vacuum or may be empty .

According to the comment,

I have two buttons in my index.html.erb which link_ for the routes I've found

You are implementing your ideas in the form of the new_sm and new_lrg in two functions: @image .

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -