Hi
I had ajax commenting on my app, which worked perfectly on Rails
v1.2.6, but does not work the same in Rails 2.02. Basically the
comment gets added, but the visual effects do not work (ie lines 2 + 3
of create.rjs)
create.js
page.insert_html :bottom, ‘comments’, :partial => ‘comment’
page.visual_effect :appear, “comment_#{@comment.id}”
page.visual_effect :highlight, “comment_#{@comment.id}”, {:startcolor
=> ‘"#84E003"’}
commentscontroller.rb:
def create
@comment = Comment.new(params[:comment])
@comment.user = User.find(current_user)
@comment.story = Story.find(params[:story_id])
respond_to do |format|
if @comment.save
format.html { redirect_to story_url(@comment.story) }
format.js
else
format.html { redirect_to story_url(@comment.story) }
end
end
end
I have tried changing to create.js.rjs, but that makes no difference?
Doe anyone have any experience with this in Rails 2.0.2?
PJ.