Hunter Mcmillen wrote:> Hey everyone,
>
> I am currently writing a Bet program, which consists of 5 forms, a home
> form and a form for all of my tables. I am trying to use the button_to
> command to link from the home controller/index to another forms/edit
> action.
>
> This is what I have so far, any help would be great:
>
> <td><%= button_to ''Decrease Date'', {:controller
=> :bets, :id =>
> Bet.find_by_milestone_id(m.id), :action => :edit} %></td>
>
> and I receive this error:
> Couldn''t find Bet without an ID
>
> Thanks,
> Hunter
So I fixed this issue, now what is happening is the that button_to
function loads the url in my browser then say Unknown Action.
But if I manually enter that same url, it goes to the page I want.
Here''s the button_to:
<td><%= if !Bet.find_by_milestone_id(m.id).nil?
button_to ''Decrease Date'', {:controller => :bets, :action
=> :edit,
:id => Bet.find_by_milestone_id(m.id)}
end %></td>
<td><%= if !Bet.find_by_milestone_id(m.id).nil?
button_to ''Increase Date'', {:controller => :bets,
:action =>
:edit, :id => Bet.find_by_milestone_id(m.id)}
end %></td>
And here''s there error:
Unknown action
No action responded to 38. Actions: create, destroy, edit, index, new,
show, and update
Any help would be great.
Thanks,
Hunter
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.