On Mon, Aug 23, 2010 at 9:38 AM, Pale Horse <[email protected]> wrote:
> I require some information, displayed at the top of a page, to change
> onclick.
>
> The information is in the following form:
>
> <h1>Name<br /><span>Job role</span></h1>
> Description... <%= link_to "read more", :controller => "controller",
> :action => "show", :id => id %>
> <p><span>telephone number</span></p>
>
> There is an image to correspond with this. The image is not a problem; I
> have gotten this image to change on click with 'link_to_function'.
>
> The information above, excluding the image of course, also needs to
> change on click.
>
> What is the best method of doing this?

Hey there,

Is that information already loaded in the page you are currently on?
If so, couldn't the function just swap out the content?

If not, and the more correct way of doing this, would be to hit some
sort of restful resource with link_to_remote and have it return
javascript to update the page with the retrieved information.

For example, slightly dated:
http://onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html

- Chris

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to