similar to: Validates numericality issue

Displaying 20 results from an estimated 40000 matches similar to: "Validates numericality issue"

2011 Feb 23
3
validates, what's wrong?
class Category < ActiveRecord::Base belongs_to :sector has_and_belongs_to_many :suppliers validates :sector, :name, :presence => true As you see I have validates :sector, :presence => true. When I create a new Category, if I don''t select a sector I have an error page with the message: Couldn''t find Sector with ID= But there is the validates, why I don''t
2011 Jun 19
10
validates_numercality_of with allow_nil.
In the model I have: validates :square_meters_public_land, :barrier_meters, :numericality => { :greater_than_or_equal_to => 0 }, :allow_nil => true but if, in the field, on create, I don''t insert a value I have the error "field is not a number". -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2011 Jun 11
15
after initialize blowing up---help
All, Can anyone see what''s happening here? ================== migration ======================= class CreateGreetings < ActiveRecord::Migration def self.up create_table :greetings do |t| t.string :greet t.string :language t.integer :count t.timestamps end end def self.down drop_table :greetings end end ================== greeting.rb
2013 Apr 27
4
required field for one, optional for another
rails 3.2.11 My app has User model, its one of the fields is entrepreneur:boolean. So users have two types; one is normal users, the other is professional users. For normal users, only emails and usernames are required and other fields are optional. For professional users, in addition to above, addresses and real names are required. Is there any Ruby way to set the requirement depending on the
2012 Oct 16
8
<form> tag is self-closing before input fields .. (HAML generator used)
The form is inside a table, enclosing a <tr> = form_tag admins_backoffice_dashboards_path, :remote =>"true" do %tr.search %th= link_to t(:clear), "#", :id => :clearFilter %th= select_tag :role, options_from_collection_for_select(Role.global, :id, :name, :selected => @role_id ) %th= text_field_tag :email, nil, :value
2012 Apr 14
7
undefined method `model_name' for NilClass:Class
Hi guys, I just started using Ruby on Rails. After implementing the RoR blog tutorial I started with my own data model. Sadly I am not able to get my create page running. Model: class Activity < ActiveRecord::Base validates :activity, :presence => true validates :forKids, :presence => true validates :start_date, :presence => true end Controller: class ActivitiesController <
2011 Aug 12
8
Need some help with regular expression
I need to validate a string from a user (a location for use with geotagging) that is. I want to make sure that the user specify a city and a country in my inp ... So i wrote this => validates :usri_location, :presence => true, :format => {:with => /^[a-zA-Z]+{\,\s}+[a-zA-Z]/i}, :on => :create I want to make sure that the user writes city,
2010 Jun 15
8
Allow blank on should validate_uniqueness_of
Hello, Using shoulda, any ideas how to allow blank when having this test: should validate_uniqueness_of(:email) Thanks. -- J. Pablo Fernández <pupeno-GAtDADarczzQT0dZR+AlfA@public.gmane.org> (http://pupeno.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
2011 Feb 28
2
form level validation, where to do it.
Form level validation involving enforcing a relation between two or more form inputs that may not even be in the model: I am building a form that will query a range of records between two dates. The form ask for a starting data and a ending date. I want to validate that the user selected a starting data before or equal to the ending date. It seems that this validation should happen in the
2010 Sep 01
5
validation errors bring up stack trace error page
hello! I made some custom validations for my app, which do catch invalid data in the console. However, when I enter invalid data through a form on the browser view, I get your stack trace error style page (similar to what you see when you get a syntax error or a nil object) instead of the nicely styled error messages (what you would see in a scaffolded application. First off, what is the stack
2012 Oct 27
7
Photo Paperclip::CommandNotFoundError
Hi all, I am using paperclip plugin. when i am trying to upload photo i am getting this error " Photo Paperclip::CommandNotFoundError " and i am getting this error on my server production mode. if i run on development mode on my server i can able to upload the pic. why this is happening i have no idea. can any help me out. Cheers, Kp -- You received this message because
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]
2012 Oct 01
12
Can I have Ruby on Rails without json
Hello, On my Chakra linux machine the json gem would not get compiled, I already made a issue for that. But for continuing my project can I have ruby on rails without the json gem ? And if so, how can I do this ? Roelof -- 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
2013 Jan 07
9
Devise Admin View password
Hi Everyone i am using devise for authentication for my app. Is there any way, Admin user can view other users password as normal string. Without storing there password as string in database? Please advise. -- 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
2011 Mar 08
6
Windows /RailsInstaller- Webrick starts but welcome page doesn't load
I''m trying the RailsInstaller to get ROR installed on Windows.. everything was going great(rake db:create/migrate and console working as expected) until I started the server, webrick starts but the welcome page never loads, no errors are displayed at all it just sits there forever, I looked at the logs and there are no errors there either Here is my configuration Windows 7 Rails 3.0.4
2012 Aug 28
16
rail s exiting
Hello everyone, I am fairly new to ruby on rails, and I come across this tutorial on treehouse where they help you make a simple version of facebook. anyway, I was writing codes, and I came across this error and I am not sure how to fix it. The error occurs after I type in rail s on the command prompt and as soon as try to look at how it looks on 127.0.0.1:3000, it gives me this error. the
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
2013 May 31
11
A simple javascript alert not working
If I have a file in view /test called index.js.erb and in it a simple alert("hello") shouldn''t that run when I go to /test/index? It doesn''t. -- 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 unsubscribe from this group and stop receiving emails from it,
2013 Feb 07
11
Rails change default time zone.
Hello everyone, I am using rails 3.2.8. I want to change time zone to New York time. I changed following, but didn''t work #config/application.rb config.time_zone = ''Eastern Time (US & Canada)'' config.active_record.default_timezone = ''Eastern Time (US & Canada)'' If am wrong please clarify. Thank You! -- You received this message
2013 Jul 19
12
Rails 4 "belongs_to: record" association doesn't work
Hi, I discovered a weird behavior when using a "belongs_to: record" association in Rails 4. Given two models A and B: class A < ActiveRecord::Base belongs_to :record, class_name: ''B'', foreign_key: ''b_id'' end class B < ActiveRecord::Base end When creating A, it inserts a record in B and returns A with id of nil: irb(main):001:0>