Displaying 20 results from an estimated 4000 matches similar to: "Building a FAQ"
2006 May 05
1
Configuration Generator
Where is this ConfigurationGenerator that is posted in the Rails wiki
(http://wiki.rubyonrails.com/rails/pages/ConfigurationGenerator)?
I''ve been searching around and I can?t find a way to use it.
Jes?s.-
--
Posted via http://www.ruby-forum.com/.
2006 Mar 23
14
Distribute Rails app. without source code
I have a commercial software that I?d like to completely re-do in Ruby
on Rails, as a web application on Apache. But I don?t want to distribute
it with the source code. Is there any way to install/deploy and Ruby on
Rails application without the source code?
Thanks in advance,
Jes?s Dugarte.-
--
Posted via http://www.ruby-forum.com/.
2006 Jun 05
5
adding habtm through migrations
Hello,
I''m stuck, I''ve got a model Product and would like to add a new model
called Category. Furthermore, I want to set up a many2many
relationship between the mentioned models. the problem is that I do
not know how to set the primary key in the categories_products table.
this is what I''ve got in my migration file:
create_table :categories do |t|
t.column :name,
2006 Jul 30
1
Doubt on composite index
The AWDwR book has the following:
add_index :categories_products, [:product_id, :category_id]
add_index :categories_products, :category_id
The first, composite index actually serves two purposes: it creates an index which can be searched
on both foreign key columns, and with most databases it also creates an
index that enables fast lookup by the product id. The second index then
completes
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories ,
basically i want to fix one product(e.g hp dv7....) to some categories
(notebook,17"notebooks...)
i made a table named categorization(incuding category_id,product_id
fields) then in models i write these codes below
class Product < ActiveRecord::Base
has_many :categories, :through => :categorizations
2006 Jul 13
1
error_messages_for
I can''t seem to figure out how to validate a few fields some1 please
help me out
model---------
class Record < ActiveRecord::Base
validates_presence_of :sw, :flex
end
controller------------
class RecordController < A;;icationController
def new
@record = Rrecord.new
@product = Product.find(params[''product_id''])
end
def create
2006 Jul 13
8
can''t convert true into integer
I have a method:
? def reduceProuctInventoryBy(product_id, reduction)
? ? t=Product.find(:first, :conditions =>["id = ?", product_id])
? ? t.qty=(t.qty-reduction)
? ? t.save
? end
and the model:
class Product < ActiveRecord::Base
? validates_presence_of :qty, :specialDescription
? validates_numericality_of :qty
end
but when i run my method, I get this:
"can''t
2009 Feb 18
3
wrong number of arguments (1 for 0)
Hello,
I am new to ruby on rails. When I tried to create a session I am
getting an error, ''wrong number of arguments (1 for 0)'', in my
controller.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ArgumentError in CustomerController#add_to_cart
wrong number of arguments (1 for 0)
RAILS_ROOT: /project/bob_shopping
Application Trace | Framework Trace | Full
2006 Jan 05
2
Agile Depot Tutorial Help
anyone can explain me why in the Agile Depot Tutorial application they
use i.product_id
to find if a product already exist in the cart, because the cart
contains items, each of them references a product.
I tried i.product_id like in the tutorial
and
i.product.i
all of these 2 notation works , but i find the second seems more
clean??? isn''t it.
Any explanation will be fine
Regards
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone,
For one of our projects we have a need to deploy and maintain a demo.
As a result I''ve attempted to setup a set of rake tasks for the job.
My goal is have one rake task called "deploy_demo" which purges the
database, migrates to the current schema, and loads the db from a set
of fixture files in a specified location.
I''ve written two new tasks the perform
2010 Apr 09
9
gem install rails (Errno::ENOENT) No such file or directory
I have two PCs, one with Windows XP and another with Windows Vista. I''m
working as an administrator in both computers. I''m using Ruby 1.8.7 and
Rubygems 1.3.6. When I try to install Rails I get this error:
C:\>gem install rails
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/Users/Jesús Dugarte
I have installed Rails several times before
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 Jun 24
2
Migrations problem with Agile Rails book
I am following the instructions on Agile Web Development with Rails book "Iteratio E1: Capturing
an Order" section. When I run the migrations I get the following error.
rake db:migrate
(in /Users/balaparanj/work/depot)
-- execute("alter table line_items \n
add constraint fk_line_item_products \n
foreign key (product_id) references products(id)")
rake
2006 Mar 14
5
GROUP BY and SUM
I have orders, order_items, and products.
I want to collate several orders so that I can get a SUM of quantities
ordered for each product etc.
Can I say something like (the below gives an error on :sum, and ignores
:group)
OrderItem.find(:all, :sum => ''quantity'', :group => ''product_id'',
:include => [:order, :product])
I want to get back a
2011 Sep 07
4
jquery and ajax query in rails 3
hi people
I don''t know much about ajax - jquery. And right now I need to use
some functionality with them.
In a form (sales model) I have the following code:
<div>
<%= f.label :product_id, "Product" %>
<%= f.collection_select( :product_id, Product.all, :id, :name,
options={} ) %>
</div>
<div>
<%= f.label :price,
2006 Jul 11
7
Rails associations: Easy Question requires dumb answer
***Scroll down to see the dumb quick question***
I have two Models:
class Template < ActiveRecord::Base
end
which has this migration:
/snip
t.column :name, :string
And the other model:
class Product < ActiveRecord::Base
has_one :template
end
with the migration:
/snip
t.column :qty, :integer, :default => 0
t.column :specialDescription, :string
t.column
2006 Jan 25
2
Agile tutorial
Thank you for the comments on conditional replacements. I now have
another oddity to deal with.
When adding products to the session cart I am not able to have the
count incremented if the product has already been selected, rather
another item is added to the cart. I copied the code from the book
as carefully as I could and could find no error but to be sure I
then cut and pasted the code
2012 Sep 13
10
access key error
I am getting following error while run my rails app in my server
ActionView::Template::Error (You did not provide both required access keys.
Please provide the access_key_id and the secret_access_key.):
--
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
2006 Jul 07
2
many-to-many error
hey all. I''m trying to set up a many-to-many relationship with products
and categories.
I''ve got the product model (product.rb) set up:
class Product < ActiveRecord::Base
has_and_belongs_to_many :categories
end
and a similar one for category.rb
And I''ve got the tables set up -- products, categories,
categories_products
But when I load, I get: undefined method
2006 Aug 13
3
Logging in Rails
This is a newbie question, I have a class which is not derived from
ActionController or ActiveRecord but I want to use logging, I tried require
but still logging does not work -
This class is located in a file in "model" directory.
------------------------------------
require ''logger''
class Cart
def add_product(product)
logger.info("Searching for product