For one action of user based on condition i want to render different
texts. So how do i achieve it through jquery?
For example:

A simple posting message application:

On post button i have a post method which has security checks and other
server side checks like :

if message_text.nil? or message_text.empty? or message_text.length > 140
respond_to do |format|
format.html {
render :text=> "<div id='outputDiv'><span
class='inputError'>Please enter message upto 140
format.xml {
render :xml=>hash_map_for_xml.to_xml(:root => "mb")

Normal post.js.erb is:
$("#div3").html("<%= escape_javascript render '/messages/timeline' %>");

which works if all is ok but how do i render messages like these when
user enters message greater than 140 characters? I have javascript
checks for them but i need these checks in case user enters it through
firebug skipping javascript.

When i see in firebug i do get the response but it is not painted on
browser as it doesnt know where to do it.

I feel i'm missing out soemthing very simple. Please let me know how can
this be achieved?

Posted via http://www.ruby-forum.com/.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
postedNov 3, '11 at 1:19p
activeNov 3, '11 at 1:19p

1 user in discussion

Prachi Tripathi: 1 post



site design / logo © 2021 Grokbase