tags:

views:

132

answers:

1

I'm trying to create a complex (from my opinion) form, but the process is going very hard. I want the form to have 4 elements:

  • A list [of subjects] and a button [to delete selected subject from list];
  • A button and an associated input field ["Add subject" and field to add it, respectively];

I think a single form wouldn't be enough, and first of all I should divide my elements in to two forms (or even nested forms - which I really don't know how to do). But what's the right way?

Even though I'm trying to make a single form with a simple add action, a receive an error [undefined method `subjects_path' for #ActionView::Base:0x485934c]. I've created the model Subjects simply by 'script/generate model' command (i.e. not by the generate scaffold). Maybe this is the root of the problem?

A: 

In essence it sounds like your view needs two forms, one to add a Subject and the other to delete a Subject via a RESTful controller. Don't forget to specify your subject resources in your routes.rb file. Perhaps if you included some code here it would be easier for others to help.

Keith Pitty
Thanks, I really forgot to tell routes about the new resource.
gmile