I'm using the highly recommended "Simply Rails 2" book with rails 3, so I've been running into problems here and there I've been able to work out for myself so far. But today I've hit a problem I can't find help with....

On page 222, there's a bit about adding some code to the webpage to show a "shove it!" button. The code that's giving me a problem is the following in the app/views/stories/show.html.erb file:

When I click on the button for that Ajax Action it output the following error on the Browser:

No route matches "/stories/7-another-story"

Do you happen to know what could possibly be wrong ?

Please help me,

Best Regards,

Jose.

Jon_Girard
—
2011-01-24T03:50:40Z —
#4

Jose,

I recently finished the "shovell" tutorial from "simply rails 2" while working with rails 3 also.

The fix to the problem regarding the ajax vote submission for me was to use the rails 2 way of doing things 'form_remote_for' with the plugin "Prototype Legacy Helper" (https://github.com/rails/prototype_legacy_helper). You might be able to get "remote => true do" to work with a bit of dabbling (I now have it working in several rails 3 projects, but at the time, I was happy to get it working even if it meant needing to use a plugin.)

It worked for me, it should work for you. Just remember to install the plugin , otherwise you'll also have to dabble with trying to get the other remote call to work with frankly, other rails 2 ways of doing things.

GranTorino
—
2011-01-24T17:29:24Z —
#5

Thank you Jon, and sorry for the duplicated thread, it's just that the forum itself suggested that I post a new one.

Anyhow, I fixed this problem some time ago, hours after asking my question, and I did it 100% rails 3, without using any plug in, and using the latest route syntax as well.

Thanks anyway! I've posted a new question though, hope that you can take a look at it !

Once again thank you very much Sir !

Jose.

malloreon
—
2011-02-08T07:01:52Z —
#6

GranTorino said:

Thank you Jon, and sorry for the duplicated thread, it's just that the forum itself suggested that I post a new one.

Anyhow, I fixed this problem some time ago, hours after asking my question, and I did it 100% rails 3, without using any plug in, and using the latest route syntax as well.

Thanks anyway! I've posted a new question though, hope that you can take a look at it !

Once again thank you very much Sir !

Jose.

Can you post your solution? I am having the same problem and googling isn't helping. Thanks!