# Re: rjs update\_page problems

**URL:** <https://www.ruby-forum.com/t/re-rjs-update-page-problems/76331>\
**Category:** Rails\
**Created:** [March 3, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/re-rjs-update-page-problems/76331 "2006-03-03T19:05:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curtis\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b2d939/32.png) [@Curtis\_E](https://www.ruby-forum.com/u/Curtis_E)\
**Post date:** [March 3, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/re-rjs-update-page-problems/76331/1 "2006-03-03T19:05:14Z")

</div>

my apologies for my previous butchery of the english language…

i have a list of, for example, meal\_names. Basically, I can submit a  
name  
and the name I add shows up in the list.I had this working when i  
created an  
actual add.rjs template for it. So, feeling good about my self, I  
attempted  
to move it all to the controller and use some update\_page goodness. Now  
the  
ajaxy magic doesn’t happen. I don’t get any errors but the list doesn’t  
update unless I refresh the page. I am not on edge rails (since it broke  
my  
app) but I am running cody’s RJS plug-in which I believe supports this  
behavior. Can anyone provide me any insight into what this is not  
working?  
It would be much appreciated. Here’s my view:

meal name: \<%= text\_field ‘meal\_name’, ‘name’ %\>  
\<%= submit\_tag ‘Add’ %\>  
\<%= end\_form\_tag %\>

\<% @meal\_names.each do |meal\_name| -%\> - **\<%= meal\_name.name %\>** \<%= link\_to "delete", { :controller =\> 'meal\_names', :action =\> 'destroy', :id =\> meal\_name.id}, :confirm =\> "are you sure you want to delete #{meal\_name.name}?" %\>
\<% end -%\>

and in my controller

def add  
@name = MealName.new  
if request.post?  
@name = MealName.create( params[:meal\_name] )  
update\_page do |page|  
page.insert\_html :bottom, ‘name\_list’, “

- #{@ name.name}
”  
page.visual\_effect :highlight, ‘name\_list’

```
    end

end

```

end
