similar to: What is the difference between new and build?

Displaying 20 results from an estimated 60000 matches similar to: "What is the difference between new and build?"

2010 Apr 16
4
DEEEEPLY nested
Hello, i have "a" has many "b", "b" has many "c", and "c" has many "d" Now... "d" is a user model, and I have a current_user helper method defined. If i navigate to an "a" show page, how can I make sure that my current_user ("d") is part of that "a"? meaning how can i make sure that
2010 Apr 28
2
Rails - associations help
Hi I have two models . Dbase -------- name vendor type port defuser - default user name Users ------- username password email I need to build an association between these two in that the dbase model''s defuser needs to be present in the users table. I am from a relational database background so am trying hard to understand rails associations. What should I do to associate the
2010 Apr 29
2
send_data => invalid byte sequence in US-ASCII
I''m trying to display a generated .png plot via send_data(), but it results in a server error "invalid byte sequence in US-ASCII" error. I''m pretty sure this means that I need to specify the encoding somewhere, but I haven''t been able to figure out where or how to do so. Some particulars: I''m running gnuplot through a pipe to generate a plot in .png
2010 Feb 23
12
"no such file to load -- gettext/rails" error
I get the error below when I try to start my server. Here are the versions installed: OS: Windows Server 2008 Ruby: 1.8.7 Gems: actionmailer (2.3.5, 1.3.5) actionpack (2.3.5, 1.13.5) actionwebservice (1.2.5) activerecord (2.3.5, 1.15.5) activeresource (2.3.5) activesupport (2.3.5, 1.4.4) cgi_multipart_eof_fix (2.5.0) daemons (1.0.10) gem_plugin
2010 Feb 03
7
could not find rmagick locally or in a repository
I unzipped simple captcha in vendor/plugins Then I did >rake simple_captcha:setup Gave error: rake aborted! no such file to load -- RMagick2.so SO I thought Rmagick has to be installed. So downloaded 2.12.0 binary gem for Ruby 1.8.6 DT 2009-10-04 16:05 RMagick-2.12.0-ImageMagick-6.5.6-8-Q8.zip Unzipped the file Ran ImageMagick-6.5.6-8-Q8-windows-dll.exe It installed the program in
2012 Sep 10
5
flash[:notice] not working
Hi, anybody please help me out,am using rails 3 but using this flash[:notice] doesnot works, i have used this in controllers. any idea ? please help. Regards, Manoj -- 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 group, send email to
2010 May 30
5
Automatically decrement value each day
I have a Person model with a points attribute. For the most part, points values will be incremented and decremented via user votes. However, I''d also like to decrement a Person''s points by half a point each day. How do I automatically decrement the value once per day? Your help is greatly appreciated :) Becky -- Posted via http://www.ruby-forum.com/. -- You received this
2010 May 06
7
Facebook, authlogic, and OAuth2
Has anyone gotten started with getting the OAuth2 replacement for Facebook Connect working with auth_logic? I know there is an OAuth2 gem (http://intridea.com/2010/4/22/oauth2- gem-just-in-time-for-facebook-graph?blog=company), and I''m thinking of using that to integrate. Anyone know when the Fb Connect API will be shut down? -- You received this message because you are subscribed to
2010 Feb 10
6
validation problems
Hi, there. I have two validations in the model: validates_numericality_of :value, :only_integer=>true, :allow_blank=>true validates_size_of :value, :is=>9, :message=>"must be 5-digit number", :if=>Proc.new{|u| u.value.is_a?(Numeric)} They work as expected except when the :value is character/string like "a" "abc", the second validation will also output
2010 May 24
5
top 10/most popular lists
What''s the best way to handle views that show the top 10/most popular/ Recently updated/most commented type listing? Should I have a separate model that is populated with records from other models by a background job or should I need to use some sort of caching? Perhaps both? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 May 24
6
Problem Installing Rails 3
I''m trying to install Rails 3 on a brand new MacBook Pro running OS X 10.6.3, Ruby 1.8.7, and Rails 2.3.5 and I''m wondering if I''ve hosed myself. So far, I''ve run these commands: $ gem update --system $ gem install arel tzinfo builder memcache-client rack rack-test rack- mount erubis mail text-format thor bundler i18n $ gem install rails --pre However, when I
2010 May 10
6
de-crypting Ruby password with php.
Hello all, I have a client with an older Rails 1.8 app (was recently upgraded from 1.6) and I need to integrate a php site to use the same user login creds. I''m not very versed with Ruby but I think this is the code that encrypts the password. [code] # Encrypts some data with the salt. def self.encrypt(password, salt) Digest::SHA1.hexdigest("--#{salt}--#{password}--")
2010 Feb 23
2
Problem: The command "rake db:create:all" crashes
Hi All, I''m running: Rails 2.3.5 MySQL 5.1.44 WindowsXP-Pro/SP3 Following Noel Rappin''s book, Pro RoR, I successfully got past the point of creating my first scaffold: ruby script/generate scaffold supplier nickname:string qbname:string That produced the migration, 20100221011210_create_suppliers.rb: class CreateSuppliers < ActiveRecord::Migration def self.up
2010 Feb 05
7
I'm having trouble with Routes II
I have narrowed my problem in a prior topic (I''m having trouble with Routes) to the fact that I get the problem, below only when I reload my page. Clicking on links to go to the pages I want ... I seem not to have problems. Given that it seems to be a reload that is generating an "/undefined" path somewhere ... can anyone suggest what I should be looking for to fix the
2010 May 04
4
OneLogin releases SAML for Ruby
We have just published a neat little toolkit for those of you who are interested in SAML-enabling your enterprise application. SAML is a standards-based single sign-on protocol, which allows an identity provider to securely log users into an application without a password. Some of the advantages of SAML that you avoid passwords altogether and can centralize access control at your identity
2010 May 17
6
validates_timeliness plugin installation
I''m trying to install the validates_timeliness plugin: on Ubuntu lucid in my rails project directory: sudo ./script/plugin install git://github.com/adzap/validates_timeliness.git ./script/plugin: command not found on windows (as admin) in my rails project directory: ruby script/plugin install git://github.com/adzap/validates_timeliness.git creates the "validates_timeliness"
2010 Apr 27
4
Translated (language-aware) routes in Rails application
Hi, I''d like to have translated languate-aware routes in my application, like: /projects/5/permissions => locale "PL" /projekty/5/pozwolenia => locale "PL" Is there any way to achieve it with RESTful routes? I have done it manually with named routes, but it''s overwhelming with over 300 routes :D Also tried namespace (yeah, didn''t work) and
2010 Apr 23
2
link_to with resource routes in helper file?
Hey all! Any pointers on doing something like: link_to "Comments", comments_path from within a helper file just like you can do from a view? Thanks in advance! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To
2006 Jul 21
4
Printed/PDF Reports (Text/Tabular/Summary) in Rails
The recent discussion about different graphing solutions made me think. What is everyone using for general reports? Currently I have a web based application at work that has roughly 20 different reports ranging from simple tabular data with totaling at the bottom to pretty, colorized, graphic logo''s,etc... going to clients, and finally complex ones I hate to think about such as
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them do not. Does anyone know if there is a way to disable the HttpMocks after they have already been loaded? The method ActiveResource::HttpMock.reset! only removes all the objects, but ActiveResource still thinks it should look for mock requests rather than actually making requests. I hope this makes sense! Thanks, Tom --