Hi *,
I generated two objects by scaffold, notice and corrective. My models
are like this:
notice.rb:
has_one corrective
corrective.rb:
belongs_to notice
Into the notice’s form I put a submit button for redirect to
corrective’s form. Now, what I’m triying to do and it doesn’t work is
passing the notice_id from notice’s form to new action of corrective
controller. Here’s my code.
notice controller, create action:
@notice = Notice.new(params[:notice])
…
format.html { redirect_to new_corrective_path, :id => @notice.id }
corrective controller, new action:
@var = params[:id]
corrective form:
<%= f.text_field :aviso_id, :value => @var %>
I don’t know what is the problem, maybe is something stupid but I’ve
been checking for two days this error. Let me know if you need another
information
Thank you