Is there a way to render a partial using a button? Basically in a content div I want the user to launch a new sub content item in the same div by clicking a button. Any help appreciated. Loving rails more and more everyday. -- Posted via http://www.ruby-forum.com/.
Arch Stanton wrote:> Is there a way to render a partial using a button? Basically in a > content div I want the user to launch a new sub content item in the same > div by clicking a button. > > Any help appreciated. > > Loving rails more and more everyday.link_to_remote("my button",:update =>''mydiv'',:url =>{:action => :myaction}) You can stylish your link to look like a button. You have to specify on myaction def myaction render(:layout => false) end Hope this helps. P http://wiki.onrails.com.ar -- Posted via http://www.ruby-forum.com/.
Pedro Visintin wrote:> > link_to_remote("my button",:update =>''mydiv'',:url =>{:action => > :myaction}) > > You can stylish your link to look like a button. > You have to specify on myaction > > def myaction > render(:layout => false) > end > > Hope this helps. > > P > > http://wiki.onrails.com.arWow that is cool. I was looking for a hack to get AJAX style behavior and Rails gives a method to do exactly that. Apparently I need to just spend the time reading the api. Thanks! -- Posted via http://www.ruby-forum.com/.