Nice tutorial, thank you very much Ryan.
Can you explain more clearly about sorting with Ajax, please? When user click header column (e.g: description), the js code in application.js is called. Then params[:sort] and params[:direction] are sent to controller. After variable @products is set, the js code in index.js.erb is executed, then product table is rendered. Do I think right, or not? If right, I don't understand why: when js code in application.js is called, the js code in index.js.erb is not executed immediately.
If I'm wrong, please explain for me about process flow when user click header column.
And one thing, what different between using ajax getScript and using :remote => true? If I want to use :remote for sorting, what things I need to change?
Thank you very much
Hello,
I implement Fixtures as you. But when I run rake db:seed, I meet error:
rake aborted!
uninitialized constant Fixtures
My seed.rb is:
require 'active_record/fixtures'
Fixtures.create_fixtures("#{Rails.root}/db", "categories")
My categories.yml is in db directory:
one:
name: Flying
I search on google and don't find anything. Please help me, thank you!
Nice tutorial, thank you very much Ryan.
Can you explain more clearly about sorting with Ajax, please? When user click header column (e.g: description), the js code in application.js is called. Then params[:sort] and params[:direction] are sent to controller. After variable @products is set, the js code in index.js.erb is executed, then product table is rendered. Do I think right, or not? If right, I don't understand why: when js code in application.js is called, the js code in index.js.erb is not executed immediately.
If I'm wrong, please explain for me about process flow when user click header column.
And one thing, what different between using ajax getScript and using :remote => true? If I want to use :remote for sorting, what things I need to change?
Thank you very much