Forum: Ruby on Rails rjs isn't update_page problems

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
4c4c46ad9a5e4df8ba4ea8353e19c2fd?d=identicon&s=25 Curtis Edmond (Guest)
on 2006-03-03 17:58
(Received via mailing list)
i have a list of, for example, meal_names. Basically, I can submit a
and the name I add shows up in the list.I had this working wehn i
created an
actual add.rjs template for it. So feeling good about my self, I
to move it all to the controller and use some update_page goodness. Now
the ajax middle doesn't happen. I don't get any errors but the list
update unless I refresh the page. I am not on edge rails (since it broke
app) but I am running cody's RJS plug-in which I believe supports this
behavior. Can anyone provide me any insight into what it's not working?
would be much appreciated. Here's my view:

meal name: <%= text_field 'meal_name', 'name' %>
<%= submit_tag 'Add' %>
<%= end_form_tag %>

<ul id="name_list">
<% @meal_names.each do |meal_name| -%>
    <li><b><%= %></b> <font size="0"><%= link_to
"delete", {
:controller => 'meal_names', :action => 'destroy', :id =>},
:confirm => "are you sure you want to delete #{}?"
<% end -%>

and in my controller

  def add
    @name =
        @name = MealName.create( params[:meal_name] )
        update_page do |page|
        page.insert_html :bottom, 'name_list', "<li>#{}</li>"
        page.visual_effect :highlight, 'name_list'


2ccb2f7699267d258faaafce4ee997df?d=identicon&s=25 Cody Fauser (Guest)
on 2006-03-05 19:26
(Received via mailing list)

Try changing your call to update_page to:

render :update do |page|
  page.insert_html :bottom, 'name_list', "<li>#{}</li>"
  page.visual_effect :highlight, 'name_list'

Also note that a lot of bleeding edge RJS features are not yet
available in the plugin, so you may want to try getting Edge working.

On 3/3/06, Curtis Edmond <> wrote:
> :controller => 'meal_names', :action => 'destroy', :id =>},
>     if
> Rails mailing list

Cody Fauser
This topic is locked and can not be replied to.