Hi all,
I start to use ruby on rails with Extjs, in a controller i put this code
respond_to do |format|
format.html
format.ext_json { render :json =>
Collection.find(:all).to_ext_json(:class => Collection) }
end
and in view i put this code
<div id="collection-grid"></div>
<%= ext_datastore_for 'Collection' %>
<% javascript_tag do -%>
var collection_column_model = new Ext.grid.ColumnModel([
{id: 'id', header: "#", width: 20, dataIndex: 'id'},
{header: 'name', dataIndex: 'collection[name]'},
{header: 'description', dataIndex: 'collection[description]'}
]);
<% end -%>
<%= ext_grid_for 'Collection', :element => 'collection-grid' %>
in the browser i have grid but without data.
any one can help me for this.
Thank's
--
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---