similar to: validate against spaces

Displaying 20 results from an estimated 9000 matches similar to: "validate against spaces"

2006 Feb 18
4
verifying best practice
i have a Project model, which belongs_to :user when i add a project, the users_id is based on the session[:users_id]. to get the users_id into the projects table, i''m doing this: @project = Project.new(params[:project]) @project.users_id = session[:users_id] this is working, i''m just verifying this is the best way to do it.
2006 Feb 19
4
is "display" a reserved name of some sort?
A view display.rhtml sees no controller state variables set in the corresponding display action. Why? -- fxn
2006 Feb 19
2
How far can you get without learning Ruby?
This has been my little experiment for the last few weeks. I jumped straight into rails after a few tutorials and have been using "Agile Web Development with Rails" as a reference. I picked up the Ruby syntax from examples which was not hard to do as I know various other languages. I''ve started 3 database driven web apps and all was going really well. Rails is fun and
2006 Feb 18
1
Premature end of script headers:....dispatch.cgi
Hi all, I have a working ruby app that I developed on Window and I am trying to deploy it on Linox with Apache. The hosting company generated for me an empty rails app and I just replaced the files that I modified in my app (only rb/rhtml/css/js files). In addition I updatd the database.yml but now I am getting either page not found or Application error Rails application failed to start
2006 Feb 18
3
Easy Newb Question
OK, so I have a link_to_remote. I am too dumb to figure out where I can set a css class or id attribute. <%= link_to_remote("X", :url => { :action => :destroy, :id => message }, :confirm => "Delete ''" + message.title + "''?", :complete => "item_removed(''item_" + message.id.to_s + "'')") %>
2006 Feb 18
4
Basic question: Where to initialize a flag?
I have found that if I initialize a flag in my controller (under def Initialize), it appears everytime I call a controller action, the flag is set to the initialize value (even though I''m not calling the initialized action). Am I observing this clearly? I don''t think I should initialize a flag in the index file. So where? Specifically, I want to know if this action is a
2006 Feb 22
3
[OT] Curly Quotes on a Mac
There''s such a Mac-friendly group here, I thought I might get some guidance. I''m happily developing everything on my PowerBook, and loving it. Yeah, TextMate is way cool. But all my clients keep sending me copy in Microsoft Word format and the curly quotes, ellipses, dashes, etc. turn into question marks. This might be overreaching, but is there some way to open the Word
2006 Feb 03
9
validating phone numbers
Anyone got a good validation for validating a phone number? I just want to make sure that whatever the user enters is somewhat sensical, and i''d like to be fairly liberal about what kind of a format it''s in. Joe
2006 Feb 17
7
Rich Text Editor (RTE)
Hello, We are developing an commercial application that need to use an RTE. Someone know one RTE editor that can I use in an commercial application? We need basic functions to format paragrapher, bold, italic, ... I found FCKEditor but it is very expensive and weight. I found this list too but don''t know what is trustful: http://www.geniisoft.com/showcase.nsf/WebEditors Some
2006 Aug 14
3
validating required fields during an update?
I have a User model with an email attribute. I''m using the following validations: validates_confirmation_of :email validates_format_of :email, :with => RFC822::EmailAddress, :message => "must be a valid address in the form user@domain.com" validates_uniqueness_of :email, :message => "address has already been taken. If you''ve forgotten your
2008 Mar 15
9
Spaces in Ruby on Rails and how to avoid them!
Hi, I just started learning ruby on rails and I am having hard time with white spacing! Here is the piece of code that will not work: validates_format_of :image_url, :with => %r{\.(gif|jpg|png)$}i, :message => "must be a URL for a GIF, JPG or PNG image" and here is the piece of code that will work: validates_format_of :image_url, :with => %r{\.(gif|jpg|png)$}i, :message
2006 Feb 21
9
SwitchTower 1.0.1, SwitchTower Extensions
SwitchTower is a utility that can execute commands in parallel on multiple servers. It allows you to define tasks, which can include commands that are executed on the servers. You can also define roles for your servers, and then specify that certain tasks apply only to certain roles. Manual: http://manuals.rubyonrails.org/read/book/17 Project:
2008 Jan 18
2
validate mac address field
Hi to all, i''d like to insert a validation inside my model about a mac address field. I''ve used this sintax but it''s not working. validates_format_of :mac_address, :with => /^((?:[-a-f0-9])+(?:[-a-f0-9])+(?:[-a-f0-9])+(?:[-a-f0-9])+(?:[-a-f0-9])+(?:[-a-f0-9]))$/i, :on => :create,
2006 Jun 14
1
file column validates_format_of
Been manually testing file column with success except it seems to upload the file before validating it. Also .pdf files (which shouldn''t even validate) crash WEBrick. What am I missing to solve these problems? (apart from a brain!) validates_presence_of :title, :file validates_format_of :file, :with => %r{.(gif|jpg|png)$}i, :message => "File must end with .jpg, .gif or
2006 Jun 29
6
Naming Convention for Controllers?
Hello! I just read DHH''s presentation pdf. In his examples, he wrote PeopleController instead of PersonController. I''ve been using singular words in controller''s name. Which is more common? Thanks. Sam -- Posted via http://www.ruby-forum.com/.
2006 Feb 21
26
Net::SMS::BulkSMS 0.1
This is the first release of a new Ruby library for the www.bulksms.co.ukAPI which should allow simple integration of SMS functionality into your Ruby or Rails apps. Sending a message is as simple as: @service = Service.new(''username'', ''password'') @service.send_message(''This is my message!'', ''4479123456789'') # whats my
2008 Jun 07
3
DRY validates_format_of?
In a model I have following validates_format_of. Is there an easy way to DRY this up? It seems to be rather repetitive. validates_format_of :expiration_date, :with => /^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/ validates_format_of :activation_date, :with => /^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/ validates_format_of :some_other_date, :with =>
2006 Jul 07
2
Testing views with Hpricot
assert_tag smells bad. Hpricot smells nice (apricotty!). Testing your views with Hpricot: http://www.lukeredpath.co.uk/index.php/2006/07/07/testing-your-rails- views-with-hpricot/ Big thanks to _why for a great little library! Feedback is appreciated. rSpec integration coming soon (hopefully!). Cheers, Luke Redpath contact@lukeredpath.co.uk -------------- next part -------------- An HTML
2006 Jun 29
2
Random routing errors in 1.1.3 with Mongrel
Since upgrading to 1.1.3 on our dev box, we''ve started to see random routing errors with our apps running under Mongrel in production mode. The errors seem to go away after a while but come back everytime we restart the server. This may be a mongrel problem, it may be a rails problem (I''ve posted a bug on the trac) and I was wondering if anybody else had had similar
2009 Feb 28
7
be_valid (validates_format_of ..., :on => :create)
Greetings, How to write Example which will check if model''s variable''s format is valid using :on => :create, like this: class User < ActiveRecord::Base ... validates_format_of :email, :with => /.../, :on => :create ... Using following code is not right: it "should ..." do @user = users(:example_user) @user.email =