I’m a new kid here. Hello!
Have a question, regarding my favourite web framework:
I have a User, Item and Wish models.
User have many Items and Wishes
Item have many Wishes
Wish belongs to User and Item
@item = Item.find(params[:id])
@wish = current_user.wishes.build
@wish = current_user.wishes.new(params[:wish])
redirect_to wishes_url, :notice => “Wish added!”
render :action => ‘new’
From Items show.html.erb template, I would the user to be able to
click a link
such, as this one: <%= link_to “Add to my wishlist”, new_wish_path()
and the user would be presented with a Wish form (fields showing:
Note, Status, whilst other fields: item_id and user_id would not be
User would submit the form and the wish would be created.
One thing, I would prefer not to use hidden fields with pre-populated
item_id and user_id as I understand these can be tempered with fairly
Hope you can help.