Sunday, February 19, 2012

Re: [Rails] Rails 3.1 - Need to show a JS pop-up with the contents of a field - can it be easily done?



On Sun, Feb 19, 2012 at 2:11 AM, Don <don.leatham@gmail.com> wrote:

I have limited screen space for a table that I'm displaying, so I'm showing a truncated view of a description field:

  <td><%= simple_format car.description.truncate(200, :separator => ' ') %></td>

I need a mouse over or click event to generate a simple pop up window (an "alert", a "tool tip", a "dialog", etc.) displaying the full contents of the car.description field. 

I'm an admitted JS rookie.  All the JS-Rails tutorials/information that I'm seeing are focused on unobtrusive JS, focused mostly on AJAX/remote server interactions.  I'm not seeing anything that helps understand how you can use data from your Rails application in rich JS UI features within your views.  I saw a tool tip gem, but with that gem, tool tip content is statically generated, and tool tips are held in their own table.  No way to generate a tool tip on the fly, based on a field pulled from the database.

Is there some very, very simple way to have JS pop up the text held in a Rails field?


What about fancybox?  fancybox.net
I use it for simple pop-up's

Javier Q 

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate