my code is in .rhtml page <%= link_to(image_tag( @plantStatusImage[i], :style=>" border:none" ,:height=>"35"), {:controller => ''device_group_details'', :action => ''index'', :id => item.plantid}, :post => true) %> but, then i redirect to my nwxt page e.i http://localhost:3000/device_group_details/index/002 and here my CSS and other javascript is not working. achually my desire link is http://localhost:3000/device_group_details/ So how can i solve this problem..what is my fault. ? and also why the CSS is not working ?
On Mon, Nov 16, 2009 at 02:43:24AM -0800, Soutom wrote:> my code is in .rhtml page <%= link_to(image_tag( @plantStatusImage[i], > :style=>" border:none" ,:height=>"35"), {:controller => > ''device_group_details'', :action => ''index'', :id => item.plantid}, > :post => true) %>What version of rails are you working with? Why can''t you do something like this? <%= link_to ''Description'', device_group_details_path(item.plantid) %> If all else fails, just specify the url manually: <%= link_to ''Description'', "/device_group_details/index/#{item.plantid}" %> -- "Oh, look: rocks!" -- Doctor Who, "Destiny of the Daleks"
2009/11/16 Soutom <soutom.dhara-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > my code is in .rhtml page > <%= link_to(image_tag( @plantStatusImage[i], :style=>" > border:none" ,:height=>"35"), {:controller => > ''device_group_details'', :action => ''index'', :id => > item.plantid}, :post => true) %> > > but, then i redirect to my nwxt page e.i > http://localhost:3000/device_group_details/index/002 > > and here my CSS and other javascript is not working. achually my > desire link is http://localhost:3000/device_group_details/ > > So how can i solve this problem..what is my fault. ? and also why the > CSS is not working ?You have specified :id => ... in link_to so it is adding the id to the url. Try without :id => Colin