Displaying 20 results from an estimated 900 matches similar to: "Agile Web Development Example Application Question"
2006 Aug 06
6
Having Problem w/ Agile Web Development book
I get this error ...
NoMethodError in StoreController#index
undefined method `salable_items'' for Product:Class
and here is my store_controller.rb ...
class StoreController < ApplicationController
def index
@products = Product.salable_items
end
def self.salable_items
find(:all, :conditions => "date_available <= now()", :order =>
"date_available
2006 Dec 04
3
uninitialized constant Product
I am actually following the instructions/code snippets from "Agile Web
Development with Rails" and got as far as page 73 where I did ruby
script/generate controller Store index, then edited
store_controller.rb to
class StoreController < ApplicationController
def index
@products = Product.salable_items
end
end
and product.rb to:
def self.salable_items
find(:all,
2006 Jan 27
4
testing for nil numeric value in find
In the agile/rails tutorial book the following construct is added
to products.rb.
def self.salable_items
find( :all,
:conditions => "date_available <= now()",
:order => "date_available desc")
end
Now, I wish to extend :conditions => to exclude products that have
a nil value for the price. I have tried different syntax
2006 Mar 06
5
Rails MySQL query
Hi,
I?m following the Depot tutorial in Agile Web Development with Rails.
I need some help to display products thats in one specific category.
mysql> select * from products where category = "jackets" does what I
want, but I?m not sure how to make a list and display it in rails?
This code displays every product with some of its fields, but I want
it to only display the products
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
I''ve encountered a perplexing problem whilst following along the demo
app in the "Agile Web Development with Rails" book. Any help would be
greatly appreciated. Here is a brief time line of my tale of woe:-
0. Been programming (business apps) and designing/building DBs for two
decades - but new to both Ruby and Rails (so I apologise in advance if
I''ve made some
2006 Jan 19
0
file_column error: tmp file created but not actual
Hi
When I submit the form with field_column, the actual
image is not
uploaded, only temp files are crreated and I dont see
actual file created and the image file name is not in
the database and get "fieldWithErrors". Then if
submit again, the actual file in created and an
database record is generated.
Here is the log file. I print @params and @wallpaper.
I find the following:
1st
2007 Oct 19
14
Agile Web Development Book, need a bit of help
I''m working my way through the book Agile Web Development with Rails,
and I am in the section where the book has me creating a display_cart
method and the associated view. When I copied the code from the book
into the view, it threw this error. If anyone could give me some hints
where I should be looking I''d appreciate it.
NoMethodError in Store#display_cart
Showing
2006 Feb 26
0
NoMethodError in Agile Web Devleopment Depot Tutorial
I''m working on building the shopping cart in the Depot tutorial in the
Agile Web Development book. I''m at the part (about page 80) where you
build the ability to add items to the cart. I''m able to get to
/store/display_cart/ and it seems items are being added, but if I just
click on a link to add an item (/store/add_to_cart/2) it gives me this:
NoMethodError in
2006 Aug 07
4
Unit testing diffculty
ok, let me show you my "products" fixtures file:
ram:
id: 1
title: RAM
description: ECC RAM Registered, 512MB
image_url: images/test.jpg
price: 29.95
date_available: 2005-01-25 00:00:00
busted_arsehole:
id: 2
title: Busted Arsehole
description: I have an arsehole, it is-e busted
image_url: images/test.jpg
price: 999.95
2006 Mar 04
2
unittest, not loading yml data
Here is my products.yml
version_control_book:
id: 1
title: Pragmatic Version Control
description: How to use version control
image_url: /images/sk_svn_small.jpg
price: 29.95
date_available: 2005-01-26 00:00:00
automation_book:
id: 2
title: Pragmatic Project Automation
description: How to automate your project
2006 Apr 20
7
checking date
Radrails created a field for date
<%= product.date_available.strftime("%y-%m-%d") %>
What does this mean?
Should the definition be date or datetime? I tried both and no results
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060420/ed0cbb14/attachment.html
2006 Apr 20
0
Please help me !
Hi To This Group!
I am new to ROR I have some problem in varible acessing in the rb file.
I worte the def in the strored controller .rb
def products_cat
$rid=params[:id]
@categories = Category.salable_items
@products_id = Product.find(params[:id])
@products = Product.salable_items1(params[:id])
flash[:notice] = "Succesfully"
end
I want to acess the varible that
2006 Apr 26
1
rake db_schema_dump make syntax error
rake migrate bug with datetime:
> rake db_schema_dump
produced a bad schema.rb that isn''t valid ruby, it has an invalid default, unless ruby
takes bare words:
t.column "date_available", :datetime, :default => Sun Jan 01 00:00:00 Arabic Standard
Time 2006, :null => false
I don''t think the Baghdad time zone should matter.
ruby 1.8.4, rails 1.1.2,
2006 Apr 01
6
how to use datepicker
This is the webpage:
http://projects.exactlyoneturtle.com/date_picker/
I have downloaded and installed it. But how do I use in view page?
This is the usual view with ordinary datetime_select:
<p><label for="product_date_available">Date available</label><br/>
<%= datetime_select ''product'', ''date_available'' %></p>
2006 Feb 12
0
no method error - you have a nil object....
hi,
i''ve been cracking my head on this one for a while and would be humbly
grateful for any pointers
i''m working through Agile Web Devopment w Rails and, in the depot
example have created the cart class for session handling, but am getting
the following error, which suggests the @items variable is not being
populated with any data from LineItem
NoMethodError (You have a
2007 Oct 07
10
Rails to English
I am currently using the book "Agile Web Development With
Rails" (2005). I am working on a fully function web application that
has a shopping cart.
The web page displays this,
ActiveRecord::StatementInvalid in AdminController#create
Mysql::Error: #23000Column ''date_available'' cannot be null: INSERT
INTO products (`image_url`, `date_available`, `price`, `title`,
2006 Feb 28
10
Scaffold command, how and what may be wrong?
hi everyone. I am learning RoR and just recently purchase the agile wed
dev on rails. i am still at the beginning of the book trying to create
the scaffold for the depot_development database. Everytime i run the
generate scaffold products admin, i recieve the "before building the
scaffold, try to create a table for model products" etc...
a few questions:
1. How does ruby know that
2005 Dec 31
2
Test Unit Problem
Hello All,
I am experiencing the following test unit error working with Rails that
I can''t fathom.
I have a products.yml file which holds the following test fixture for
the products table:
dell_pc:
id: 1
title: Dell PC
description: Dell PC
image_url: http://.../pc_image.jpg
price: 15000.00
date_available: 2005-12-31 06:53:00
I also have the following product_test.rb file to
2006 Mar 13
7
Wilcard search
Hello,
I''m writing a search function for my application, but I am unsure on how
to search for all results that contain my search string; here''s what
I''ve got:
def search
@products = Product.find(:all,
:conditions => "date_available < now()",
:conditions => [ "title ilike ?",
2006 Aug 13
1
Using ENUM column in table
Hi,
When I create a table with one column of type ENUM and then generate
scaffolding for the model and controller the ENUM column isn''t shown as
a drop down in the edit view. It just shows the column name and that''s
it. Am I missing something?
Here''s the SQL for the table:
drop table if exists products;
CREATE TABLE products (
id INTEGER UNSIGNED NOT NULL