Can we write ruby code directly in an rjs file?
I have to replace a div with
<%= text_field “ciclass”, “name”, “size” => 20, “value” => @class_name,
:readonly => “readonly” %>
<%= hidden_field “ci”, “ci_class”, “value” => @class_id %>
For doing this i’ve to write the above code in a partial file and
update the div as follows in the rjs file as shown below:
page.replace_html “div_name”, :partial => “partial_file_name”
I was looking for a simpler way so that i can avoid writing a partial
file for the above 2 lines.
Is there any way to write the above code directly in rjs file?