search for: comment_count

Displaying 6 results from an estimated 6 matches for "comment_count".

Did you mean: comments_count
2011 Aug 20
0
undefined method `comment_count' for YouTubeG
`eval'': undefined method `comment_count'' for #<YouTubeG::Model::Video:0xcdd2668> (NoMethodError) http://youtube-g.rubyforge.org/ in response object i checked i am not getting comment_count I am also using view_count and it is coming in response. previously i was getting comment_count but now getting error. i am using R...
2006 Mar 17
2
Security issue dealing with comment posting - anyone?
...n makes sense, but I''ve tried other things, and can''t get anything else to work. #currently def comments content = Content.find(params[:id]) @comment = Comment.new(params[:comment]) content.comments << @comment content.save if @comment.save then @comment_count = Comment.count("content_id=#{params[:id]}") render_without_layout else render :text => "Error" end end #what i''ve tried def comments ... if @comment.save then @comment_count = Comment.count(:conditions => ["content_id=?",...
2006 Mar 17
1
How to handle errors - HELP
...ment. How can I handle this in my code? Do I use "rescue nil" or something? Here''s my controller: def comments content = Content.find(params[:id]) @comment = Comment.new(params[:comment]) content.comments << @comment content.save @comment.save @comment_count = Comment.count("content_id=#{params[:id]}") render_without_layout end If the comment is blank, then do I want to rescue the nil, then "render :text => ''Please fill out the fields.''"? Then in my remote form options, on the :update, I could have: :...
2006 May 06
1
Ajax commenting - PLEASE HELP!!!!
...lt="" style="display: none;" /></p> <%= end_form_tag %> </div> #CONTROLLER def comments post = Post.find(params[:id]) @comment = Comment.new(params[:comment]) post.comments << @comment post.save if @comment.save then @comment_count = Comment.count("post_id=#{params[:id]}") render_without_layout else render :text => "Error saving comment" end end -- Posted via http://www.ruby-forum.com/.
2006 Mar 17
0
Returning from Ajax call - "redirect_to error"
...:in `redirect_to'' ... ... With the second line continuing forever. Here''s my controller: #controller def comments content = Content.find(params[:id]) @comment = Comment.new(params[:comment]) content.comments << @comment content.save @comment.save @comment_count = Comment.count("content_id=#{params[:id]}") render_without_layout end #remote form <%= form_remote_tag( :url => {:controller => ''inventory'', :action => ''comments'', :id => content.id}, :update => {:success =&g...
2006 Jan 19
5
TIP: Using field_error_proc to add style attributes to form elements
I just put this up on the wiki, and thought I''d share in case it''s useful to anyone else. This is handy if you don?t want to wrap your input elements inside a div when an error occurs, but instead want to add some sort of CSS style to fields with errors: ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| msg = instance.error_message error_style =