similar to: validation errors bring up stack trace error page

Displaying 20 results from an estimated 7000 matches similar to: "validation errors bring up stack trace error page"

2011 Apr 18
2
acts_as_commentable validations
Hi all, I recently started back up with Rails and things are going well up until now. I''ve set up acts_as_commentable in my Post model and it''s working great. Problem is users are able to create a "blank" comment. I''ve added the following validations in the comment.rb file generated by acts_as_commentable to limit the comment length: [code]
2009 Aug 16
5
any help with captcha in my comments ?
this is my error: Processing ApplicationController#create (for 127.0.0.1 at 2009-08-17 00:57:56) [POST] Parameters: {"comment"=>{"name"=>"asdasd", "body"=>"asdasd"}, "commit"=>"Add Comment", "post_id"=>"19",
2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers. class CommentsController < ApplicationController meantime_filter :set_scope before_filter :find_comment, :only => %w(show edit update destroy) def index @comments = Comment.find(:all) end def new @Comment = Comment.new end def create @comment = Comment.create!(params[:comment])
2011 Jan 17
4
Factory Girl and attr_accessor with validation
I have a problem with a recent change to one of my models when created via Factory.create. class User < ActiveRecord::Base attr_accessor :tc_check validates :tc_check, :presence => true, :acceptance => true ... end The following definition fails, when calling Factory.create(:valid_user) Factory.define :valid_user, :class => User do |u| u.email
2007 May 20
9
How to test for exceptions
Hi folks, I''m in the process of converting a Test::Unit functional test to RSpec, but I''ve run into a slight problem. I tried looking through the documentation but I still don''t know what I missed. Thanks in advance, Blake describe VenuesController, "on update" do before(:each) do @venue = mock("venue")
2010 Apr 02
6
App_Controller and partial issues with has_many through
I have a User model, a Post model, and an Interest model: User has_many posts through interests User has_many interests, dependent destroy Post has_many users through interests has_many interests, dependent destroy Post has_many interests Interest belongs to Post Interest belongs to User Application_Controller is as follows: class ApplicationController < ActionController::Base before_filter
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
Hello all, I am currently writing model tests in rails 4. I am attempting to add an error to a reservation object if the total number of reservations for a given date and time has reached a pre-determined limit. When my test runs, it is hitting the appropriate code but it is raising the following error as opposed to just giving me an error in the object that I can use.
2011 Jan 05
16
Nicedit (rich text editor)
Hello, I''m trying to use Nicedit to improve my text_areas in some views of my project. I have installed jquery: ruby script/plugin install git://github.com/aaronchi/jrails.git nicEdit plugin: ruby script/plugin install git://github.com/sergio-fry/Simple-nicEdit.git Add js in layout: <%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %> Use it
2007 May 31
4
Sample Merb App
I put together a sample app to help people learn Merb: http://svn.depixelate.com/applications/invoice_tracker/ I also blogged about it here: http://depixelate.com/2007/5/31/taking-merb-for-a-spin -- Zack Chandler http://depixelate.com
2006 Nov 22
3
Controller Isolation
Hi, I have a project that I had running under rspec 0.6.x and recently upgraded to 0.7.2. I am trying to isolate my controllers from the database as I go through and change all the specs to run under 0.7.2. I am having a problem where I need to make the create! method return the mocked object as well as raise RecordInvalid exception. Is this at all possible? I use the rescue statement in my
2011 Aug 04
1
Creating form for associated has_many model
This example shows how to create a form for an associated model ''Comment'', where ''Comment'' belongs_to ''Post'' and ''Post has_many ''Comments''. http://edgeguides.rubyonrails.org/getting_started.html#generating-a-controller How might I modify that to display all the comments in the form, and still have it call the
2008 Jan 31
3
presenting validation errors via fbml?
Hi Facebookers, Is there a helper or suggested approach for presenting validation errors on an fbml form? Something to translate rails error markup to fbml:error markup? thanks Joel
2006 Jun 08
5
Displaying Calculation on Index
Hi, I am trying to create a simple point system and display the total on my index page. So I have my db basically setup like this: Posts id, body, created_at, user_id Post_points id, post_id, user_id, created_at, value So as you can see I am allowing other users to create points on the post and my db will store who gave the point as well. "value" is the point value which can
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog. map.resources :posts do |posts| posts.resources :comments, :trackbacks end Now comments are at /posts/:post_id/comments. Okay but what if I want to list all the comments for all the posts. It should be at /comments, but that isn''t map that way. Can I map comments twice? -- Posted via http://www.ruby-forum.com/.
2009 Jul 04
12
save! not allowed after validates_uniqueness
I have this in a model validates_uniqueness_of :aspect, :scope => :user_id In an instance method of the same model I have "save!" but I don''t touch the :aspect attribute in that instance method at all. Whenever that save! command is run however I get this error: ActiveRecord::RecordInvalid: Validation failed: Aspect has already been taken I don''t
2010 Sep 28
4
Unitialized constant controller
Hey guys, Here''s an error I get after I hit the submit button on the editing page: NameError in ClassifiedsController#update uninitialized constant ClassifiedsController Help would be appreciated. Thanks -- 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
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe one of you guys can help me out. I''ll show my sweeper and then my log to show that it "should" be working. class PragmaticSweeper < ActionController::Caching::Sweeper observe Comment def after_save(comment) expire_page(comment.post_id) end private def expire_page(post_id)
2007 Aug 08
5
Can''t seem to spec a ActiveRecord::RecordInvalid exception properly...
1 def create 2 @user = User.new(params[:user]) 3 @user.save! 4 self.current_user = @user 5 redirect_to user_path(@user) 6 flash[:notice] = "Thanks for signing up!" 7 rescue ActiveRecord::RecordInvalid 8 render :action => ''new'' 9 end I can''t seem to properly spec this out. I am trying numerous things, the latest one is
2005 Mar 10
10
Some Basic Questions
Sorry I can''t access IRC from work so I hope you don''t mind me asking my newbie questions here: 1) I have the following code: @post = Post.find(@params[''id'']) @comments = Comment.find_all "post_id = #@params[''id'']", "created_on ASC" And I am have problems with the second line. I want to pass the id from my post to the
2006 Jul 04
8
writing to many_to_many table
I have three tables. users, posts, users_posts. This last one is to mark a post as read. How do I write to the users_post table? Here''s what I have: In model ''User_Post'' belongs_to :post belongs_to :user In post/view/show: <%= link_to "Mark As Read", :controller => ''post'', :action => ''post_read'', :user =>