This project is archived and is in readonly mode.
UJS doesn't work
Reported by Nikolay | January 9th, 2011 @ 10:29 AM
Rails 3.0.3 Ruby 1.9.1
I am trying to do search form by ajax as shown at "http://railscasts.com/episodes/205-unobtrusive-javascript".
But javascript code generated from index.js.erb file does not
execute.
I was try to get response by this command:
wget -O response --header='X-Requested-With: XMLHttpRequest' --header='Accept: text/javascript, /' 'http://localhost:3000/posts?utf8=%E2%9C%93&search=main'
and response was right: https://gist.github.com/771588
I am confused why this code does not execute in a browser
Order of my actions:
rails new blog
rake db:create
rails generate controller home index
- write 'root :to => "home#index"' in 'config/routes.rb' - and
delete 'get "home/index"' rm public/index.html
rails generate scaffold Post name:string title:string
content:text
rake db:migrate
- then i have edited some files attached here
Comments and changes to this ticket
-
Oscar Del Ben January 9th, 2011 @ 10:14 PM
Did you include the javascript files in your layout? Does firebug or any js console report any error?
-
Dan Pickett March 12th, 2011 @ 03:28 PM
- State changed from new to invalid
- Assigned user set to Santiago Pastorino
[state:invalid]
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>