ruby on rails - Setting hidden field in edit form -
i'm creating posts blogs. here's code create post
= simple_form_for post |f| = f.error_notification = f.input :title = f.input :content = f.hidden_field :blog_id, value: params[:blog_id] = f.button :submit
creating works fine, when tried edit created post same form got error. console log:
"post"=>{"title"=>"xzcascdasd", "content"=>"", "blog_id"=>""}, "commit"=>"update post", "id"=>"2"}
should set here blog_id? doesnt work without blog_id too. ideas?
= f.hidden_field :blog_id, value: params[:blog_id] params[:blog_id] existing on page ??
Comments
Post a Comment