similar to: save / update and validate

Displaying 20 results from an estimated 6000 matches similar to: "save / update and validate"

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
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:
2005 Dec 27
4
How do you detect if ActiveRecord ''update'' fails?
So I''m updating multiple model objects in one go with something like this in my controller: => Photo.update(params[:photo].keys, params[:photo].values) When the update fails due to validation errors, how do I detect it? The Rails API says: "If the save fails under validations, the unsaved object is still returned." So I can''t simply do this: => if
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 Nov 17
4
set empty values as null in the database
Le''s say that I have a table called people and the column middle_name is nullable. If the user enters say blank or empty space then in the database it is recorded as empty space. I would like in all my models all empty spaces to be recorded as null. I guess I can write a plugin which will do so for all the models but I''m sure something like that should already be existing.I
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/.
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
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
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 Jul 14
2
how to get builder 2.0 to escape attributes in rxml
I am using rxml to produce opml files and need to escape ampersands in the attributes. builder 2.0 docs found at http://builder.rubyforge.org/ show the following xml = Builder::XmlMarkup.new xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There") xml.target! => <sample escaped="This&amp;That"
2007 Mar 09
5
storing customer CC on gateway
I posted this late yesterday afternoon to no response, so I figured I''d try once more to get the morning people''s attention. I''m working on setting up the credit card processing part of a rails app for my company and running into some issues. I''m currently working with the ActiveMerchant plugin and connecting to our account at Authorize.net.
2005 Dec 27
1
How do you detect if ''update'' save fails?
So I''m updating multiple model objects in one go with something like this in my controller: => Photo.update(params[:photo].keys, params[:photo].values) When the update fails due to validation errors, how do I detect it? The Rails API says: "If the save fails under validations, the unsaved object is still returned." So I can''t simply do this: => if
2006 Mar 29
4
trouble adding to database (stringify_keys)
I''m brand new to rails and am trying to build a simple ajax email collection form. It''s just a coming soon sort of thing where the user can enter his email address in the field, hit submit, and the ajax form dumps the email into the database and says "success" unless the email is blank or not unique in which case it says "failure." The trouble is, no
2012 Apr 25
2
Test oddities
Can someone explain why a instance variable cannot be changed through an association under rspec/factory_girl? An example is in this gist<https://gist.github.com/2484336> . All tests pass except the last. All the steps pass in the console. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web
2007 Jun 27
5
How to make attachment_fu generate RESTFUL URL
hi folks: I follow this article:http://clarkware.com/cgi/blosxom/2007/02/24 all goes well except the public_filename ,it return something like "photos/0000/0001/test.jpg" ,not the expected RESTFUL URL LIKE ''photos/1/test.jpg'',any suggestion? My Env is Rails 1.2.3 on Ruby 1.8.6 with attachment_fu from http ://svn.techno-weenie.net/projects/plugins/attachment_fu/ by now
2006 May 20
10
HOW TO create a new record and its associated objects within the SAME PAGE
hi, can''t find any good tutorial or advice to deal with the creation of a new record and it''s associated objects within the same page. do i have to use ajax just to add custom form fields that will be handled by the controller for associated objects creation.? do i have to use ajax to add associated objects to the unsaved but allready in session parent object? what''s
2006 Jul 27
2
accessing a variable inside a plugin
Hello, I would like to load an Hash in my init.rb plugin file ... than I would like to use this hash in my module ... in my init.rb: @anHash = load From file... in mymodule: module Amodule def myFunction #@anHash .... end end How can I access to my hash in my plugin module function ? thanks for this dummy question ;-) Arnaud
2006 Nov 18
1
ETS eMoney?
Anyone used ETS Corporation''s EMoney ECOM Gateway ? I''m working on a project that will have to interface to it and if the work has already been done was hoping not to re-invent the wheel. Failing that, which payment gateway gem option is better - ActiveMerchant or Payment, or are there others ? I''m willing to add the work done for this to whichever option we use in