search for: add_com

Displaying 20 results from an estimated 21 matches for "add_com".

Did you mean: add_dom
2006 Jun 28
3
couple newbie questions
...er controller and another action to enable adding of comment. Something like the following ? <%= link_to "Comment", { # link_to options *:contoller* => ''comment'', *:action* => ''add_comment'', *:id* => company}, { # html options *:post* => *true* } When I click on the "Comment" link generated by the code above it tries t...
2008 Apr 14
2
Problems with nil object
...def index @posts = Post.find(:all, :order => "data DESC") end def show_comment @posts = Post.find(:all, :order => "data DESC") @comments = Comment.find(:all, :conditions => [''post_id= ?'', params[:id] ]) end def add_comment @posts = Post.find(:all, :order => "data DESC") @comments = Comment.find(:all, :conditions => [''post_id= ?'', params[:id] ]) @com = Comment.new(:post_id => params[:post_id]) if flash[:comment] @comment = flash[:comment] e...
2006 Apr 05
2
How to add add child items to parent via parent show view?
I want to know the standard/easiest way to add items to a parent? Example: comment added to post I would like this to happen in the ?show? view of post using a form that is shown when the user clicks the ?add new? button/link. I would also like validation on the child form with the validation errors appearing in the post show? view. Two problems are presented: 1) When the user clicks the
2006 Aug 14
4
Updating a table with Ajax
..._list''> <table> <% for @comment in @comments %> <%= render :partial => ''comment_list'' %> <% end %> </table> </div> <p>You can <a href="#" onclick="Element.toggle(''add_comment''); return false;">add a comment</a>.</p> <div id=''add_comment'' style=''display: none;''> <%= form_remote_tag :update => ''comment_list'', :position => :bottom, :url => {:action => ''...
2007 Jan 21
1
Strange Ajax Error Since Upgrade
...following error: ------------------- FORM REQUEST ------------------- [2007-01-21 23:15:26] ERROR bad header ''"{\n"''. [2007-01-21 23:15:26] ERROR HTTPRequest#fixup: WEBrick::HTTPStatus::LengthRequired occured. 127.0.0.1 - - [21/Jan/2007:23:15:26 GMT] "POST /picture/add_comment/13 HTTP/1.1" 400 301 - -> /picture/add_comment/13 ------------------- LINK_TO_REMOTE REQUEST ------------------- [2007-01-21 23:17:26] ERROR bad header ''"{\n"''. [2007-01-21 23:17:26] ERROR HTTPRequest#fixup: WEBrick::HTTPStatus::LengthRequired occured. 127.0...
2006 May 15
33
acts_as_commentable release
...Person object: class Person < ActiveRecord::Base acts_as_commentable end Then you have a person: p = Person.find(:first) Create a comment: c = Comment.new Fill out the comment c.name = "Name of Commentor" c.content = "What they wrote" then add it to your object: p.add_comment(c) to remove a comment: p.remove_comment(c) I think that''s everything. This was done quick and dirty, If there are things you would like to see in this, let me know. I don''t know if there is much more to do that wouldn''t be application specific. Thanks Josh
2010 Mar 05
15
Three submits, one controller
I have a ''new'' page with a submit for creating stories. On the ''show'' page the submit allows a user to enter comments. I now want a ''edit'' page for the stories with another submit for updates. I have used the ''create'' and ''update'' methods in the stories_controller on the ''new'' and
2006 Sep 07
6
form_for - Child object - how to set parent id
...<% end %> <div class="comment_form" > <%= error_messages_for ''comment'' %> <fieldset> <legend>Add your comment:</legend> <% form_for :comment, :url => { :action => :add_comment } do |form| %> <p> <label for="name" >Name:</label> <%= form.text_field :name %> </p> <p> <label for="email" >E-Mail:<...
2001 Sep 30
3
UTF-8 stuff
...ULL,0,0,0} }; @@ -37,7 +37,6 @@ int commentcount; char **comments; int tempoutfile; - char *encoding; } param_t; #define MODE_NONE 0 @@ -47,8 +46,8 @@ /* prototypes */ void usage(void); -void print_comments(FILE *out, vorbis_comment *vc, char *encoding); -int add_comment(char *line, vorbis_comment *vc, char *encoding); +void print_comments(FILE *out, vorbis_comment *vc); +int add_comment(char *line, vorbis_comment *vc); param_t *new_param(void); void parse_options(int argc, char *argv[], param_t *param); @@ -98,7 +97,7 @@ /* extract and...
2006 Feb 10
1
validation error reporting on child object
...ext" in my Comment AR class, and it appears that the empty comment is no longer being inserted into the db. However, I can''t figure out how to display the error message on the comment object (1 to M child of proposal) in the page. I put an else on the call to save the comment in my add_comment action and that works. But I can''t figure out where the error message going. Looked at "@proposal.comments.inspect" in the view, I don''t see an error message. thanks, b
2006 Feb 21
2
validations and directing errors
I am starting to play with validations as I want to catch errors before SQL rejects inserts to the table which are ugly when nulls are sent to ''Not Null'' columns, etc. If I do something in my model like... validates_format_of :first_name, :with => /^\w+$/, :message => "you moron, enter a name" I still end up
2007 Sep 23
9
Code reviews: my dumb use of acts_as_commentable (newbie)
...mment @comment = Comment.new # fine, I guess. @comment.title = params[:review][:new_comment_title] # seems complicated @comment.comment = params[:review][:new_comment_body] # ditto @review = Review.find(params[:review][:survey_id]) # from saved for later @review.add_comment(@comment) # fine redirect_to(:back) end Sure, it works, but there has to be a simpler way than defining comment-specific variables in my model, and subsequent references in my controller. What say ye, oh gods of Rails? Striketh me down with thy wisdome and simplicitie! Tom &quot...
2006 Jun 16
0
Polling pop3 and adding emails to ticket system
...essfully updated.'' redirect_to :action => ''show'', :id => @ticket else render :action => ''edit'' end end def destroy Ticket.find(params[:id]).destroy redirect_to :action => ''list'' end def add_comment @comment = Ticket.find(params[:id]).comments.create(params[:comment]) redirect_to :action => ''show'', :id => params[:id], :comment=> @comment end def poll_pop3 require ''net/pop'' pop = Net::POP3.new(''mail'') po...
2010 Jan 05
0
Problem with associating comments with blog posts on same page
...t; Posted <%=h time_ago_in_words(post.created_at) %> ago </p> <p> Approved: <%= h(post.approved) %> </p> <p class="post_post"> <%= simple_format h(post.body) %> </p> <% randomNumber = rand(100000) %> <img src="/images/add_comment.jpg" class="add_comment_image<%= randomNumber %>" /> <div id="comments<%= randomNumber %>"> <%= render :partial => post.comments %> <h1>New comment</h1> <% form_for :comment, :url => { :controller => "co...
2012 Mar 02
0
[LLVMdev] make check-all : errors in clang and llvm
...: error: CHECK-NOT: string occurred! %before = load i32* %p ^ /scratch/user/download/release_30/llvm/test/Transforms/GVN/null-aliases-nothing.ll:18:18: note: CHECK-NOT: pattern specified here ; CHECK-NOT: load ^ -- [reply <http://llvm.org/bugs/show_bug.cgi?id=12163#add_comment>] [-]<http://llvm.org/bugs/show_bug.cgi?id=12163#> Comment 1 <http://llvm.org/bugs/show_bug.cgi?id=12163#c1> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120302/1dc49a80/attachment.html...
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
Hi guys! ;) If you set "routes.rb" as: map.resources :pocoyo You have RESTful rails routes facilites. Ok, let''s focus on these two maps: "http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller and "index" action. "http://domain.com/pocoyo" [POST] is mapped to "pocoyo" controller and "create"
2007 Sep 22
1
Rails newbie: passing a value to hidden form field, then getting it
...he user hits submit In the survey_controller.rb I have def save_comment @comment = Comment.new(params[:comment]) logger << "COMMENT #{@comment.comment}\n" # @survey = Survey.find(?????????) # somehow I need to get that survey id so I can do the next line @survey.add_comment(@comment) end Question 2: what magic do I need to get at the value in the hidden field? Like I said, I am a noob. Thanks for your tolerance of my ignorance. Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Group...
2002 Nov 14
1
comment tags
I'm trying to write comment writer thing for zinf, because I love the program, but it doesn't fully support ogg. I've found how to read comments, but can't figure how to write them. There has been some discussion about this previously in the archives, but I couldn't find any specifics, only references to code not posted to the list. The api documentation page is (painfully)
2009 Dec 27
5
Difficulties in understanding Rail-Plugins in depth
Hi, i try to understand how plugins work in detail. Often you see stuff like: class Post < ActiveRecord::Base   acts_as_commentable end I wonder what''s happen all there. What kind of language-feature is behind this call "acts_as_commentable" ? In my opinion you need some kind of extend or include to extend the functionality of a model. And exactly this is which i found
2010 Feb 11
1
[PATCH] Provides a reference implementation management server.
...2 @@ +[egg_info] +tag_build = dev +tag_svn_revision = true + +[easy_install] +find_links = http://www.pylonshq.com/download/ + +[nosetests] +with-pylons=test.ini + +# Babel configuration +[compile_catalog] +domain = ovirtserver +directory = ovirtserver/i18n +statistics = true + +[extract_messages] +add_comments = TRANSLATORS: +output_file = ovirtserver/i18n/ovirtserver.pot +width = 80 +keywords = l_ + +[init_catalog] +domain = ovirtserver +input_file = ovirtserver/i18n/ovirtserver.pot +output_dir = ovirtserver/i18n + +[update_catalog] +domain = ovirtserver +input_file = ovirtserver/i18n/ovirtserver.p...