Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

UJS doesn't work

#6269

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

Reported by Nikolay · January 9th, 2011 @ 10:29 AM

State: invalid
Milestone: none
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: none

Activity

  1. Oscar Del Ben
    Oscar Del Ben

    Did you include the javascript files in your layout? Does firebug or any js console report any error?

    January 9th, 2011 @ 10:14 PM

  2. Nikolay
    Nikolay

    Sorry, it is my fail. Everything works fine.

    January 11th, 2011 @ 04:44 PM

  3. Dan Pickett
    Dan Pickett
    • State changed from new to invalid
    • Assigned user set to Santiago Pastorino

    [state:invalid]

    March 12th, 2011 @ 03:28 PM