similar to: set empty values as null in the database

Displaying 20 results from an estimated 3000 matches similar to: "set empty values as null in the database"

2007 Jan 26
7
How to protect attributes from being updated?
Hi! I''m new to Rails! Rails rox! 1 quesion so far: I have :email attribute in User model. I dont'' want :email to allow to be updated. How do i do this with Rails? Do I have to implement required validation manually? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Aug 10
6
Login Restfully
In DHH''s keynote, he alluded to doing logins with REST. Has anyone implemented this, and if so, would you mind elaborating on how you did it please? Thanks in advance. -- Posted via http://www.ruby-forum.com/.
2007 Feb 07
2
Image Downloads in IE
Hi, This may not be a rails issue, if not apologies. I have an application which allows image downloads. The image is downloaded with the code: send_data(@wallpaper.image, :filename => @wallpaper.path, :type => @wallpaper.image_content_type, :disposition => "downloaded") However, Internet Explorer doesn''t download the image, it
2006 Mar 16
5
TimeZone, TZInfo, daylight savings, and composed_of
Does anyone know the best way to track time zone information. There doesn''t seem to be much documentation on this. So far it seems like a simple db field like create table accounts ( id int unsigned not null auto_increment, name varchar(50) not null, time_zone varchar(50) not null, ... primary key (id) ) and a class like class Account < AR ...
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
2007 Mar 24
4
image file URL generated by image_tag include some parameter
I''m using image_tag to generate img tag. URL of image file generated by image_tag include a parameter like following. "http:// ..... /images/filename.gif?123123123" What''s this number parameter for? How can I remove it? I''m using rails with built-in WEBrick server in test mode. --~--~---------~--~----~------------~-------~--~----~ You received this message
2006 Aug 09
6
How to change the error message easy way
validates_presence_of :fname results in the error message "Fname can''t be blank". What I want is "First Name can''t be blank". I could do this def validate errors.add_to_base("First Name can''t be blank") if fname.blank? end I find this clunky and I have to put everyrhing in the validate method. Is there an easy to get what I want. I
2005 Oct 25
3
How to get the source code for login generator
Hi, I installed login generator using gem. It''s installed and it''s working fine. I wanted to browse the source code of login generator installed by gem. I couldn''t find the source code anywhere. Thanks. -=- Neeraj _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2006 Jul 26
2
How to highlight the search term in the search result
In the ''basecamp'' product from 37signals if I search for ''ruby'' the I get a bunch of results. In the search result page the search term (ruby in this case) is highlighted. I was wondering how to accomplish the same. How to highlight the ''search term'' in the search result? Is there any already existing utility that I could use? Thanks.
2006 Apr 27
2
How to override pagination_links method
I intend to override pagination_links method. I added following lines of code in application_helper.rb module ActionView module Helpers def pagination_links(paginator, options={}, html_options={}) raise("boom!!") end end end But my code is not executing my code. The view is still using the method pagination_links from rails. What''s the correct way to override
2007 Jan 16
4
Subdomain Account Keys Best Practice
Hi all, I''m thinking of useing sub-domains as account keys, something I''ve played with previously. I have accounts and users, fairly standard, except that users can belong to many accounts, and accounts can have many users. So I figure I need to have an area on the main domain, that allows users to view their account memberships and things. Sort of like a dashboard for each
2007 Feb 01
6
Using a nonstandard foreign key
Hopefully this is an interesting question. I have a "user" table with a field "email_address". I would like the part of "email_address" after the ''@'' to be a foreign key to a "companies" table populated by a companies that are clients. Any pointers on how to do this in rails? --~--~---------~--~----~------------~-------~--~----~ You
2006 Feb 06
7
Delaying initialization of associations until first access
Guys, Say I have the following: ----- class Person < ActiveRecord::Base has_one :house end class House < ActiveRecord::Base belongs_to :person attr_accessor :color end ----- Then I have the following code: ----- john = Person.new john.house.color = "Blue" john.save ----- What I would like to have happen, is that on first call to john.house, if house hadn''t been
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got everything connecting and working as it should. I have a Users table in Oracle: create_table "users", :force => true do |t| t.column "username", :string t.column "created_on", :datetime t.column "email", :string t.column "note", :text
2006 Aug 17
8
instance variables in templates
Hey all, Well... hmm... feeling pretty stupid here... For some reason my controller instance variables are not displaying in my templates. I''ve boiled it down to this test case. class Rss::FilmController < ApplicationController def display @time = Time.now end end and the template: <html> <head> <title>Is This Ever Going To Work</title>
2006 Aug 15
7
mongrel_cluster not starting on reboot
Hi, I''m in the process of moving my blog over from lighttpd -> apache 2.2 + mongrel. Everything works fine as long as I don''t reboot :) On reboot apache comes up but mongrel_cluster doesn''t start up the pooches... I have added the mongrel_cluster call to my startup scripts like so: www:/etc/init.d# update-rc.d mongrel_cluster defaults Adding system startup for
2006 Jan 31
2
Relationship navigation issue
class Event < ActiveRecord::Base belongs_to :venue belongs_to :category end class Venue < ActiveRecord::Base belongs_to :city end class City < ActiveRecord::Base belongs_to :state end I want to retrieve all event records belonging to a state. Coming from hibernate background I tried something like this: def self.list_for_a_state(state_id) find_by_sql(["select e.*
2006 Jul 05
2
How to write get functional test when there is no action by that name
I have following line in route.rb #event info for an event name map.connect ''event/:name_url'',:controller => ''home'',:action => ''event_info'' It causes a URL like http://localhost:3000/event/_jewels_exhibition_ to be sent to the home controller with action as ''event_info''. I am trying to test this action. My first
2007 Mar 23
2
assert_select VS assert_no_tag
Hi everybody. Assert_no_tag will be deprecated soon. How can i use assert_select for checking not existed tag? Thanks. Bye. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2006 Jan 30
9
Something as after_successful_validation?
I need to call callback only if the validation was successful, but it seems it is called also when validation fails. -- Posted via http://www.ruby-forum.com/.