similar to: New version of AWDwR

Displaying 20 results from an estimated 2000 matches similar to: "New version of AWDwR"

2007 Aug 21
4
[AWDwR] Confused about has_one and has_many
Heya everyone! I am quite new to Rails and I am reading AWDwR. I am at Task E "Check Out!". I understand it quite well, but I have a problem with the last playground exercise: Add a Table which contains the payment types. All goes well, but I am not sure whether I should use has_many or has_one(as in the Playground wiki at http://wiki.pragprog.com/cgi-bin/wiki.cgi/PT-E-3). I use the
2006 Mar 07
17
Handling Erros from AWDWR
I''m getting to the point now where I really need to start trapping the errors. So from my AWDWR book, I added the following directly from the book into application.rb... def rescue_action_in_public(exception) case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction render(:file => "#{RAILS_ROOT}/public/404.html",
2006 Jul 22
4
Reading floating points into a field stored as Integers
Hi, I''m trying to follow the "AWDR" example of storing certain types of numbers (in my case, percentages not money) as integers in the database. I understand from the Depot application how to format the output to have 2 places (or n places for that matter) decimal. Now, I"m wondering about the input. It''s more natural for people to enter numbers as
2006 Jul 16
17
AWDWR question
In an early section on Action View, showing code being put directly into the rhtml file: <% require ''date'' DAY_NAMES = %w{ Sunday Monday Tuesday Wednesday Thursday Friday Saturday } today = Date.today %> <h1>Hello, Dave</h1> <p> It''s <%= DAY_NAMES[today.wday] %>. Tomorrow is <%= DAY_NAMES[(today + 1).wday %>. </p> I get this
2006 Aug 07
4
AWDwR typography question
So, I''ve been listing to stuff folks have been saying about the Bookman font we use. Most people like the font, but some feel there aren''t enough words/line, so your eyes move too much. So, I spent the weekend playing with typography, and I''ve come up with a compromise. The thing is: it looks good to me, but I don''t want to mess up the read for others
2006 Aug 16
4
Accessing Constants Declared in Helper Modules
Hello all, I''m having great trouble accessing a constant declared in a helper for one of my view templates. I am trying to create a grouped selection list based on a predefined set of values. Rather than declare this set of values in the view, I wanted to put it in the helper that automatically gets included for the view. Unfortunately, it doesn''t seem to work. All methods
2006 Aug 02
2
Help please: AWDWR -- Migration failure
I''m having a problem with one of the migration files from the depot application. ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == AddPrice: migrating ======================================================== -- add_column(:products, :price, :decimal, {:scale=>2, :default=>0, :precision=> 8}) rake aborted! You
2006 Nov 04
0
New version of the AWDwR beta book available
I''ve uploaded the B1.12 version of AWDwR. The major changes include: - Justin Gehtland''s new chapter on Web 2.0 - James Duncan Davisdon''s chapter on deployment (this is an interesting one---JDD has strong opinions on how a Rails application should be deployed, and the chapter mirrors this. You''ll find it short and easy to follow). - I changed the
2011 Feb 19
11
Completely broken rails install on OSX
Hi I am new to rails and I was trying to get version 2.1.1 installed so that I could run lovdbyless and play with Rails to see what it was like. When trying to install lovdbyless I kept getting problems when running "rake" so I looked around for an answer and did what the forums said, and then i''d get another error and i''d go through the same process. Now I am getting
2006 May 05
11
Rails Recipes or AWDWR 2 ?
Hi, I bougth the Agile Web Development with rails First Edition and now want buy rails recipes but what is the best decision buy rails recipes or the new edition de Agile Web Development With Rails? Jean Carlo Schechnner www.idvirtual.com -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 May 02
96
[ADV] Second Edition of Agile Web Development with Rails
ANNOUNCING AGILE WEB DEVELOPMENT WITH RAILS, SECOND EDITION =========================================================== http://www.pragmaticprogrammer.com/titles/rails2/ Rails has changed a lot since we announced the first edition of the book a year ago. DHH says that the 1.1 release "boasts more than 500 fixes, tweaks, and features from more than 100 contributors." Who are we to
2006 Aug 04
8
Demo in rails2.pdf of add_price migration, PostgreSQL 8.1.4
People, I''m looking at the migrate example on p 74 of the rails2.pdf It''s a simple example of using a migration to add a column to the products table. Here is a copy of the migration file named 002_add_price.rb after I generated and then edited it: class AddPrice < ActiveRecord::Migration def self.up add_column :products, :price, :decimal, :precision => 8, :scale
2006 Jul 21
1
saving money as decimals now ok?
Now that Rails core converts a database''s decimal type into a Ruby BigDecimal type, is it ok to now store money information as a decimal in the database (instead of an integer)? Joe
2006 Mar 19
2
Unit test confusion
Hey all, I''m following along with AWDWR, specifically the unit testing. On page 148, it shows you how Test::Unit::TestCase will automatically define instance variables based on your fixtures. It doesn''t seem to actually work, though. It seems that both @artists ["beatles"]["name"] and @beatles.name are nil objects in my test, where as
2006 Feb 07
1
AWDWR: NameError (uninitialized constant UnknownAction) in rescue_action_in_public
I copied (and modified) this code from AWDWR: def rescue_action_in_public(exception) case exception when ActiveRecord::RecordNotFound, ActionController::UnknownAction render :template=>''/error'', :layout=>''application'', :status=>''404 Not Found'' else render :template=>''/error'',
2008 Mar 01
2
No route matches with {:method=>:get} Error in AWDWR Book
Hi I''m working on the AWDWR book and I''m on the admin section of the book. I have rails 2 installed on my machine and I have ran into an error when I created my controller login but when I go to http://localhost:3000/login/index I get this error: No route matches "/login/index" with {:method=>:get} I haven''t touched the routes.rb file and when I generated
2007 Feb 04
10
Spec''ing ActionMailer
Good morning (Pacific Time). I have a controller action that, as a side-effect, sends an email to an administrator. I want it to do something like this: specify "when someone successfully signs up, an email should be sent to the administrator with the person''s contact page" do post :signup, {...lots o'' params} response should_be success #
2006 Jul 10
2
Problem with migrations, postgresql, AWDwR
Hi all, Rails 1.1.4 Rake 0.7.1 PostgreSQL 8.1.4 Windows XP Pro I checked for errata on pragmaticprogrammer.com, but didn''t see any explicit mention of this issue. I''m going over the depot example in AWDwR, 2nd ed, and I can''t get the migration to work on p. 82. Specifically, the AddTestData example (with reduced description text to save my fingers some typing):
2006 Jun 08
7
The Agile Book Messageboard?
Hello. Where is there an Agile Messageboard? On the first part of the Depot example, a price field shouldn''t be an integer right? (it should be more of a float since a price has decimals) Dominic Son -- Posted via http://www.ruby-forum.com/.
2006 Jun 19
12
AWDWR- Question
I''m having a particularly difficult time undersanding one lesson from this book. This is in relation ot how one would grab "search" parameters from web forms to search for records in the database. I understand the :conditions part of find() but am confused on the code: 1- name = params[:name] pos = Order.find(:all, :conditions => ["name = ? and pay_type =