ruby on rails - ActionController::ParameterMissing (param is missing or the value is empty: film): -
So, I'm having the following error when I try to go to the Movies page on my app:
ActionController :: ParameterMissing (Ultimate is missing or value is empty: film): 2014-07-24T22: 04: 44.622356 + 00: 00 applications [web.1]: app / controller / saas_admin / movies_controller.rb Category Saas Admin :: Films Controller & lt; SaasAdminController inherit_resources belong_to: Studio ,: Finder = & gt; : Find_by_id !,: param = & gt; : Studio_ID ,: class_name = & gt; Studio before_filter: set_sort_fields ,: only = & gt; : Edit before_filter: build_collections ,: only = & gt; [: New, Create, Edit, Update: Creating Def] Creating! {Parent_path (parent.id)} In relation to redirecting # studios, Studio_ID has been replaced End DEF update @film = movie.find_b_partlink (param [: id]) response_to do | Format | If @movie.update (allowed_uprum) format.html {redirect_to saas_admin_studio_path (@ film.studio), notice: 'The movie was updated successfully.' } {Format.json head: no_content} else format.html {Submission of action: 'edit'} {format.json json render: @ film.errors, position :: unprocessable_entity} end-end end DEF index redirect_to PARENT_PATH (parent. Id) End DEIF Show @ clip = Resource.clips.paginate (: Page => Parameters [: page],: per-page => 30,: order = & gt; 'clip.section') Interval protected Def resource # @film || = End_of_association_chain.find_by_permalink (parameter [: id]) @film || = End_of_association_chain.find_by_permalink (parameter [: id]) End DEF collection @films || = End_of_association_chain.paginate (: page = & gt; parameter! [: Page],: per_page => 30,: order => 'movies.created_at') End Def set_sort_fields resource.sort_name = '' if resource Name == resource.sort_name End Def build_collections @studios || = Studio.find (All:) allowed DEF permission. Ultimate Parameters.Require (. Movie) .Permit (: name, sort_name, description, short_description, meta_data, poster, amazon_link, active, trackable, country_IDs = & Gt; []) End End What M might it be? I was trying to understand it for a while, but perhaps a new eyes will come to know that it is not easy anymore.
Cheers!
Edit Code / new.html to see movies here. ARB
& lt; H1 & gt; & Lt;% = @page_title = "new # {resource_class}"% & gt; & Lt; / H1> & Lt;% = Form_ for processing ,: url = & gt; Collection_path ,: html = & gt; {: Multipurpose = & gt; True} what? F | -% & gt; & Lt;% = Render: Partial = & gt; "Form",: local = & gt; {: F = & gt; F}%> & Lt;% end -% & gt; & Lt;% content_for: sidebar% & gt; & Lt;% = Render: Partial = & gt; "Saas_admin / shared / sidebar"% & gt; & Lt;% end% & gt; and movie / edit.html.erb
& lt; H1 & gt; & Lt;% = @page_title = "# {resource_class} Edit"% " & Lt; / H1> & Lt;% = Form_ for processing ,: url = & gt; Saas_admin_studio_film_path (Parents, Resources),: HTML = & gt; {: Multipurpose = & gt; True} what? F | -% & gt; & Lt;% = Render: Partial = & gt; "Form",: local = & gt; {: F = & gt; F}%> & Lt;% end -% & gt; & Lt;% content_for: sidebar% & gt; & Lt;% = Render: Partial = & gt; "Saas_admin / shared / sidebar"% & gt; & Lt;% end% & gt;
>
Code> DEF allowed_or_ma {: movie = & gt; Params.fetch (: film, {}) permit (: name ,:,,,,,,,,,,,,,, Div>
This is happening because you have specified your parameters through 'movie' through strong_params (above your specified_most code Specified in).
Whatever the visual side is doing (whether it is a link or a form / etc), it is not to be passed nested norms under 'Film'.) If you are in the action of the controller To do raise params.inspect , you will see that there is no node for "movie". Most likely what is wrong that you have the form code, the visual side is not properly set to nest these parameters, do you use form_tag for example are doing?
Comments
Post a Comment