Displaying 6 results from an estimated 6 matches for "commentform".
2006 Apr 11
5
RJS adds comment but doesn''t update form
...ts.create(params[:comment])
render :update do |page|
# show the new comment at the top of the comments display
page.insert_html(:top, "comments", :partial => "comment")
# quick and dirty way to empty the form that was just submitted
page.replace_html("commentform", :partial => "commentform")
end
--
Posted via http://www.ruby-forum.com/.
2006 Mar 09
7
how to make two forms on the same page???
I can get the forms to be displayed, but i want to have only one
"create" button. i''ve tried everything i can think of...
--
Posted via http://www.ruby-forum.com/.
2006 Jan 18
0
form_remote_tag and 302 redirects under IE6 bug
...update => {:success => ''commentList''},
:loading => "loading()",
:complete => "complete(request)",
:failure => "failure(request)",
:html => {:id=>"commentform",:class=>"commentform"},
302 =>
"document.location=request.getResponseHeader(''location'');" %>
##### end code ####
This works fine under firefox, but the javascript assigned to the 302
handler never gets called in IE. No javas...
2010 Oct 14
7
undefined method?
...to do |format|
format.html
format.xml { render :xml => @comment }
end
end
========
views/controller1/new.haml contains
========
= render ''form''
========
and _form.html.erb contains
========
<%= form_for(@comment) do |format| %>
<div class=''commentForm''>
<%= format.label :name %><br />
<%= format.text_field :name %><br />
<%= format.label :content %><br />
<%= format.text_area :content %><br />
<div class=''commentSend''>
<%= format.submit %>...
2006 Apr 07
3
Ajax render a template
...o create a new comment
<div id="divcomment">
<b>Leave a Reply</b>
<%= form_remote_tag(:update => ''newcomments'', :url => {:action =>
:comment, :id => @post}, :position => "before") %>
<%= render :partial => ''commentform'' %>
<p><%= submit_tag "Comment!" %></p>
<%= end_form_tag %>
</div>
This is my def in the blog controller t handle the creation of the new
comment
def comment
Post.find(params[:id]).comments.create(params[:comment])
render_text "retu...
2006 Apr 09
12
Validating two models from one form
Howdy,
I''m working on my first RoR project, and I want to build a form. The
tricky thing is, this form needs to insert / update against two models,
each with their own validation rules. Unfortunately, I''m having an
incredible amount of difficulty with the error handling, specifically
the fields wrapped in <div class=''fieldWithErrors''></div>