5

I'm trying to build a simple inventory app, and I was wanting to have a page with a list of items, with only a name label and an editable box to update the instock amount and a single update button to update them all.

My model is named item and with two fields, name and instock

I'm not sure if you need more info, thanks.

* After playing around with it, I'm able to build the form, but when I click on update, it gives the error: Couldn't find Item with ID=edit_multiple

Here is part of my controller:

   def edit_multiple
 @items = Item.find(params[:id])

And here is my routes.rb

resources :items do
collection do
  get :search
  post :edit_multiple
  put :update_multiple
end

if anyone has any pointers or help, I'd appreciate it.

thanks,

2
  • and where/what is the problem? Commented Apr 7, 2011 at 15:25
  • Basically, I can follow along those screencasts up until the submit section, then I'm not getting the edit / update_multiple peiece Commented Apr 7, 2011 at 15:52

2 Answers 2

6

Check out these screencasts:

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! I've tried to follow along with those, but I get stuck at the submit action. I'm not following how to edit my routes.rb file to follow along I believe. Here is mine route.rb: ' resources :items do collection do get :search end'
what is the difference between 198 and 165?
0

I had the same problem, and solved it by manually describing the path to the controller action in the edit_multiple form, like this:

= semantic_form_for :isbn, :url => {:controller => 'isbns', :action => 'update_multiple'}, :html=>{:method=>:put} do |f|

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.