Displaying 20 results from an estimated 500 matches similar to: "Migrations problem with Agile Rails book"
2006 Feb 05
8
Agile Rails book: depot problem
I recently finished the first part of the "Agile Rails" book. But, the
depot doesn''t completely work as it should. I still have 2 problems:
I will explain them in 2 threads.
The first one is:
I can''t destroy products (I can only creat and update them). When I try
to delete a product --> http://localhost:3001/admin/destroy/3
I get this error message:
2006 Mar 30
13
Trying Agile book, found problem
Pg. 57 of Agile asks you to create a scaffolding by typing in
ruby script/generate scaffold Product Admin
Instead of generating everything, it only gives me
exists app/controllers/
exists app/helpers/
exists app/views/admin
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical
2006 Feb 24
7
One To Many To Many
Hey all,
I''m trying to find a simple way to reference all of the objects that
belong to their parent''s parent. In other words:
Clients --> Orders --> LineItems
How do I get all of a client''s lineitems in one array (i.e.,
client.all_lineitems)?
Thanks!
-Neal
--
Posted via http://www.ruby-forum.com/.
2006 May 06
4
Scaffold Uses Wrong Host for MySQL user
I''m following the example Depot app in Agile Web Development with Rails.
The scaffold fails because it is not using the correct host for the
user. Here is the error that the scaffold emits:
Access denied for user ''jimmy''@''%'' to database ''depot_development''
The MySql user ''jimmy'' was created with the host of
2006 Jun 14
6
Lost Connection to MySQL
Error Message: MyMysql::Error: Lost connection to MySQL server during query:
SHOW FIELDS FROM products
Running Fedora 5, using available Red Hat modules and latest version of Rails.
This problem just appeared. I had been enjoying going through the tutorial "Depot"
when it started displaying this problem. With phpMyAdmin I am able to access the
depot_development data base containing
2006 Jun 01
3
Webtrends For Rails ???
Is there any tools that is similar to Webtrends that can be used with Rails based Web sites? TIA
http://www.ProblemSolvingSkill.net
Hone your problem-solving skills
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations?
order = Order.new(:name => "My Order")
order.line_items << LineItem.new(:product_id => 1, :quantity => 2)
order.line_items << LineItem.new(:product_id => 2, :quantity => 5)
order.save
The above - which is by far the most elegant way of putting it - doesn''t
work for me - the line_items
2006 Oct 13
3
How to get a count of line_items
I am fairly new to Rails, and I am having difficulty in forgetting the
old way of developing and using the Rails way.
This is my question, using orders and line_items as an example.
An order has_many line_items
A line_item belongs to order
In my OrdersController I have
def summary
@orders = Orders.find(:all)
render :xml => @orders.to_xml()
end
What I want to achieve is to
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2006 Jan 24
3
Is there a concise way?
Hi,
Is there a concise/ruby way to do the following:
[Note: 1 and 2 below are not related.]
(1)
for p in 0...@order.line_items[k].shipment_lines.length
shipline_qty = shipline_qty +
@order.line_items[k].shipment_lines[p].quantity
end
(2)
ts = Array.new
for tk in s.trackings
ts.push(tk)
end
2006 Jul 30
1
Insert multiple new child records with the parent
Hello,
I am implementing a classic invoice application. On the create new
invoice page
I want to allow users to add new line items using AJAX:
-----------------------------------------------------------------------------
Invoice Date [ ]
Client [ ]
Line Items
1. [ ] $[ ]
<add new line item>
<save> <cancel>
2006 Mar 28
3
I hope this is not spamming
I do not want to get the reputation as a spammer and be hated by the ruby and rails community??!
But where are the best forums for help with rails and ruby please, and which ones are the most user freindly?
I have a little tech problem:
I have a lap top running xp home service pack two
and I have installed ruby 1.8.2 and rails 1.0.0 I also have mysql 4.1.16-nt via tcp/ip running on the laptop, so
2006 Jan 28
10
Rails scaffolding - cannot get access to MySQL
Hi,
A newbie in the RoR world, I''m already more or less stuck when
generating the scaffold for my first tutorial project ...
When I try to generate scaffold code for my version of the ''depot''
application from the ''Agile rails ...'' book, I receive the following
error:
#28000Access denied for user ''bo''@''localhost''
2006 Jul 20
3
Instant Rails not finding database
Hey there
I''ve got instant rails installed, and it''s phpmyadmin can find the
database at the ascribed mysql port (3210)
...however, altho i have got my ''depot_development'' db in there (along
with the other dbs that ship with instant rails)... the rake script from
the instant rails command interface cant find ''depot_development''.
Looking at
2006 Sep 03
2
Undefined method "xxx" of a model when calling a helper
Hi all
I''m creating a shop page. I have a cart model that looks like the
following:
class Cart
attr_reader :line_items
def get_line_item id
@line_items.each do |l|
return l if l.id == id
end
end
def initialize
@line_items = []
end
def empty!
initialize
end
def empty?
return true if @line_items.empty?
false
end
end
And I have some
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
2006 Jan 12
5
Question about using DISTINCT in ActiveRecord find method.
Hi,
Am relatively new to the RoR world. My question is quite simple.
I have a query like such:
shipmentNumbers = Order.find_by_sql(["select distinct s.id from orders
o, line_items li, shipment_lines sl, shipments s where o.number=? and
o.id = li.order_id and li.id = sl.line_item_id and sl.shipment_id =
s.id", number])
The above query works fine. I wanted to do the same query using
2006 May 02
4
Bug in rails ?
Hi !
I just have a simple question.
I am writing an app using rails to familiarize myself with the framework (which is pretty cool, by the way).
I just wanted to know why these two work differently (since "find" should be a synonym for "detect" according to the Pick Axe) :
current_item = @invoice.line_items.detect {|i| i.product.id == key}
current_item =
2006 Apr 20
5
strange mysql problem
i have this model:
class LineItem < ActiveRecord::Base
belongs_to :quote
end
in the console:
>>l = LineItem.create
ActiveRecord::StatementInvalid: Mysql::Error: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '' , , , )'' at line 1:
INSERT INTO line_items (`qty`, `quote_id`,
2010 Apr 13
5
How to check if a parent has children?
What is the new way to check if a parent has child items? In rails
1.2.6 I did this:
if @client.has_line_items?
Client being the parent and line_items the children.
Now that I have upgraded to rails 2.0.1 (on my way to current :-) ) I
am getting this message:
undefined method `has_line_items?'' for #<Client:0x7f3b093b01a0>
How should I format the query now?
Regards,
Paul