So I have the following link which passes a parameter experience_id to the new action of an experience_skills controller.
<%= button_to 'Add Skill', new_experience_skill_path(:experience_id => experience.id),:remote => "true", :class => "btn", :id => "new-experience-skill-btn" %>
This works out just fine– i.e. params[:experience_id] is the right value!
The problem is that I need to access params[:experience_id] in my create action of the experience_skills controller in order for some javascript and ajax to function correctly.
How can I access the parameter passed to the new action within the create action???
Thank you for your help in advance.
And of course if you give me the right answer, I will accept it as so.
-Alex
which place you trying to access the params[:experience_id] ? in new action or create action?
in your form,you can do like this ,Example:
then, in your controller in new action
nt sure it can help u ..
Modified:
if not mistaken, it will only at New, lets said from my scenario, in the new controller of Message, it need the advertisement_id which is the hidden field, in order to create Message, it need advertisement_id as well, so, i ‘ll do
then when I saved my Message model (which is in the create action controller), it will save all the detail.