How to use edit ajax link in controller

hi all,

i want to put the html coding in my controller, because i want to
return the value like this. but i don’t how to declare here. i declared,
but it show error. i have listed my coding here. plese tell me what’s
the error in this asap.

@return_string+="


" + company.street_addr + "
" +company.city + "
" +company.state + "
" + company.pin + "
" + company.branch +
"
" +
link_to_remote ‘EDIT’,
:update => ‘detail’,
:with =>"‘company_id=’+#{company.id}",
:url    => { :action => 'edit_comp' }

                                 + "</td></tr>"

my Error is:

app/controllers/oddworlders_controller.rb:197: syntax error, unexpected
tSTRING_BEG, expecting kDO or ‘{’ or ‘(’
link_to_remote “EDIT”,
^
app/controllers/oddworlders_controller.rb:197: syntax error, unexpected
‘,’, expecting kEND
app/controllers/oddworlders_controller.rb:198: syntax error, unexpected
‘,’, expecting kEND
app/controllers/oddworlders_controller.rb:199: syntax error, unexpected
‘,’, expecting kEND

Try this, Using the %{} make declaring a string over multiple lines
easer and then you can also use direct #{} substitution for the
variables which removes all the ‘+’ and ‘"’ characters.

@return_string += %{


#{company.street_addr}
#{company.city}
#{company.state}
#{company.pin}
#{company.branch}
link_to_remote ‘EDIT’, :update =>
‘detail’, :with => “company_id=#{company.id}”, :url => { :action =>
‘edit_comp’ }
}

David.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs