I’m trying to update a specific div section by trying to add some
embedded ruby code below. It’s not liking it though. You see below
i’m trying to replace >>> :update => “msg_box>”, <<< with >>> :update
=> “msg_box_<%= item.id %>”, <<< but it’s bad syntax or something. How
can I do this?
Here’s my little Ruby on Rails webpage that uses Ajax:
<%= link_to_remote( "Item Details",
### normally its :update => "msg_box>",
:update => "msg_box_<%= item.id %>",
### you see in the line above i'm trying to update the div with id
"msg_box_1" for example...
:url =>{ :action => :get_details }) %>
I’m trying to update a specific div section by trying to add some
embedded ruby code below. It’s not liking it though. You see below
i’m trying to replace >>> :update => “msg_box>”, <<< with >>> :update
=> “msg_box_<%= item.id %>”, <<< but it’s bad syntax or something. How
can I do this?
I do that so often I need to DRY up my statements for it. To match the
rest
of Rails, and borrow its methods, I’d guess the system should be
‘msg_box[1]’. But that’s not your problem.
<%= link_to_remote( "Item Details",
normally its :update => “msg_box>”,
:update => "msg_box_<%= item.id %>",
You forgot to add the actual id to the DIV’s id itself. It still says
‘msg_box’.
I’m trying to have a link update a specific div box. for example, the
first “Item Details” link would update the div box that I have appended
the item.id to for targeting purposes.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.