Hi
i am using nested resources,here project having has many relation with
defects.
Main problem here is i am not getting project_id from edit form.What's a
problem if any one knows please help.

edit.html.erb
<% form_for(@defect,@project) do |f| %>
<%=f.text_field :name%>
<%end%>

routes.rb
  map.resources :projects,:has_many=>:defects
  map.resources :defects

defecs_controller.rb
 before_filter :get_project
  private
  def get_project
    @project = Project.find(params[:project_id])
  end

def edit
  code for update defects
end

Here problem is from edit form i am getting project id.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to