I am trying to use wice grid plugin and I have run into problem. The
problem is when I have nested paths as follows:
Hardware :has_many installed_softwares
Software :has_many installed_softwares
installed_softwares belongs_to both
when I view individual hardware, I have a link "Installed Software"
->
hardware_installed_softwares
when I use wicegrid to view installed software and I create a link to
show, edit and delete. nothing displays on the page. when i look at
page source -- there is on <th></th>
here is the view:
<%= grid(@installed_softwares) do |g|
g.column :column_name =>''Software:'', :attribute_name
=> ''name'',
:no_filter => true,
:model_class => Software do |isoftware|
isoftware.software.name
end
g.column do |isoftware|
link_to "Show", hardware_installed_softwares_path
(:hardware_id,isoftware)
end
end %>
here is controller view:
class InstalledSoftwaresController < ApplicationController
def index
# @hardware = Hardware.find(params[:hardware_id])
# @softwares = @hardware.find(:hardware_id).installed_softwares
@installed_softwares = initialize_grid(InstalledSoftware,
:include => :software,
:conditions => [''hardware_id =
?'',params
[:hardware_id]],
:per_page => 20)
end
THanks in advance for your help
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---