Is anyone else finding it frustrating to do in Ruby client-side things
that would be simple in Javascript?
It seems like all of the “helpers” involve server (controller)
communication.
For example, having a text field that just echos below what the user
types.
Is this the only way to do it?
<%= text_field_tag 'user_text'%>
<%= javascript_tag("Event.observe('user_text', 'keypress',
function(event) { Element.update('stylized_word',
$F(Event.element(event)));})")%>
Thank you!
Chris
Chris, this is just the example. You might want to use that for chat for
example, where text that user types appears not only on his computer,
but for others.
Clearly, if you are doing it for one user there is no point in using
server-side, but again this is just the example
Chris H. wrote:
Is anyone else finding it frustrating to do in Ruby client-side things
that would be simple in Javascript?
It seems like all of the “helpers” involve server (controller)
communication.
For example, having a text field that just echos below what the user
types.
Is this the only way to do it?
<%= text_field_tag 'user_text'%>
<%= javascript_tag("Event.observe('user_text', 'keypress',
function(event) { Element.update('stylized_word',
$F(Event.element(event)));})")%>
Thank you!
Chris