> def create
> if simple_captcha_valid?
> @post = Post.find(params[:post_id])
> @comment = @post.comments.create!(params[:comment])
> else
> flash[:notice] = "please right down the image verification"
> end
>
> respond_to do |format|
> format.html { @post.valid? ? redirect_to @post : render :action
> => :new }
> format.js
> end
> end
>
> # create.rjs if you are using prototype. I'm not sure of the exact
> syntax here, but
> # you get the idea. Something has to send back the js to make the
> error appear. Nothing
> # will be rendered on success
> if flash[:error] # when errors are present
> page.update :flash_error, flash[:notice]
> end
( page.insert_html :bottom, :comments, :partial => @comment
pa...@comment].visual_effect :highlight
page[:new_comment].reset )
nop :/ thats not working :/
im not writing correct the rjs code :/
any help in rjs please ?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---