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.
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.
Arch S. 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
Pedro V. 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 myactiondef myaction
render(:layout => false)
endHope this helps.
P
Wow 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!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs