views:

12

answers:

0

Hey. I'm trying to execute an extremely simple RJS feature and having a lot of trouble—it's defaulting to html refresh. This is my code, any help would be greatly appreciated:

<div id="main">

<% remote_form_for(@question) do |f| %>
    <%= f.error_messages %> <%= f.text_field :target %>.
    <%= f.text_area :message %>
    <%= f.text_area :context %>
    <%= f.submit "Add", :class => "button" %>

<% end %>
<%= render @feed %>

Create.js.rjs:

page.insert_html :bottom, :main, :partial => @question
page[@question].visual_effect :highlight

Questions Controller

def create
...
@question.save!
respond_to do |format|
  format.html {redirect_to :back}
  format.xml {render :xml => @question, :status => :created, :location => @question}
  format.js 
end