Displaying 20 results from an estimated 3000 matches similar to: "What is wrong in this method??????"
2006 Mar 17
1
How to update values in database in this form?
Hi,
This is my rHtml page & Corresponding actions & model pages:-
===listform.rHtml=================
<h1>Products List</h1>
<%= start_form_tag(:action => "add_to_cart")%>
<table>
<tr>
<%
i=0
%>
<th>
Product No.
</th>
<th>
Unit Price
</th>
<th>
Available Qty.
</th>
<th>
Demand Qty.
</th>
2006 May 08
7
How to get difference between two dates in days???
Hi,
I want to calculate difference between Current date & previous date
(stored in database). The difference should be in days. Hhow to do
that??
PLs tell me.
Thanx in advance.
Prash
--
Posted via http://www.ruby-forum.com/.
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 Mar 22
7
What is difference between render & redirect methods?
Hi,
Thest are two methods:-
1) redirect_to :action => ''list''
2) render :action => ''list''
what is difference between these two methods??????
Thanks.
Prash
--
Posted via http://www.ruby-forum.com/.
2008 Feb 20
1
text_field_tag - different parameter name
Hi, I have one problem with validation
I am creating e-shop and I have products. This view look like this:
<% for product in @category.products %>
<div class="produktyBox">
<%= product.title %><br />
Price: <br />
<div style="color:red; font-size:large; font-weight:bold; margin-
bottom:5px"><%=
2006 Apr 11
2
Extending Depot Example
Hi
I am new to the whole Rails/Ruby world as having come from a MS .NET
background, but I have followed the Depot example in the Agile Web Dev.
with Rails book with relative ease. However as an exercise to see how
much I had understood, I thought I would attempt to modify the example a
bit and add a Quantity field to the store index so as to pass that value
into the cart. I have extended the
2006 Apr 21
9
Yet another dry question..
One of these days I''ll figure this out, but in the meantime help me be a
better programmer by eliminating some excess code:
I''m trying to check to see if somebody trying to view/edit/update a
product is the owner. In my scaffold I have this code that works:
def edit
@owner = Product.find(params[:id].to_i)
if @owner.user_id == @user.id
@product =
2006 Jun 08
5
How to find particular pattern in string?
Hi,
In my application I want to find out the occurance of substring
"http:\\" in the main string "http:\\www.abc.com"
Here how to find out whether substring "http:\\" is present in my
String?
& if substring "http:\\" is present then I want to delete it from main
string.
How to do this?
PLs help me.
Thanx in advance.
Prash
--
Posted via
2005 Dec 19
2
Difficulty using correct moldel for the data in DB
Hi everyone,
I''ve tried posting the same question to the list last Friday but
somehow did not see it being posted..
I''ve just started with Rails and Ruby. I just started to play one of
those RPG and to get my feet wet I''m writing an app to keep track of
item fusions. So the scoop is that item can be fused with another
items to create a higher level item. The higher
2006 Jul 27
1
form_remote_tag
How can I get a name/id for a form using the remote form tag?
<%= form_remote_tag :url => { :action => :add_to_cart, :id => timecard }
%>
gives me:
<form action="/timecard/add_to_cart/4"
method="post"
onsubmit="new Ajax.Request(''/timecard/add_to_cart/4'',
{asynchronous:true, evalScripts:true,
2006 Mar 17
3
How to check for presence of particular value entered ?
Hi,
I am entering value in textbox ("name") on form. Now name field in
database is having ''unique'' constraint on it so that no 2 records with
same name allowed in database. Now when I m trying to enter same name
into database from my form I m getting following error.
================================
Mysql::Error: #23000Duplicate entry ''Prashant''
2006 Feb 27
1
Nested hash from form params into create()?
Hi,
I''m really excited about getting the create() method working on a
nested hash. The Rails book make it seem like I''m close to doing the
right thing but I think something very small is not quite right. The
error at the below isn''t giving any hints that I understand.
I have a form that produces a nested params hash and sends it to my
add_to_cart controller method.
2005 Sep 02
4
Error has me stumped (Agile Web Dev with Rails book)
Hello everyone,
I''m a complete Rails newbie who is currently working my way through
the Agile Web Dev with Rails book. I''ve reached the chapter on
creating the shopping cart (chapter 8).
I keep having a problem with the same error which I can''t get past,
however what''s more confusing is that it''s being generated even when I
swap all my app code out
2006 Apr 05
3
how to insert Current DateTime value into database?
Hi,
I want to insert onto database the Current DateTime Value into database
field "Store_date" with datatype (DATETIME). How to do tihs?
I am usiing hidden variable into my form as follows:-
=======================
<%= hidden_field("store", "store_date", :value =>:datetime ) %>
=======================
But when I m submmittng form I couldn''t find
2006 May 09
2
name and class href attribute in a link_to_remote
I have a link to remote and I''m trying to get the name="" and the
class="" attribute in the href so the link will come out like this:
<a href="action" onclick"ajax(action)" name="Title Of Link"
class="someclass">
So far the link looks like this:
<% for course in @courses %>
<%= link_to_remote
2008 Sep 03
2
Highlighint rjs problem on a new product
Hi,
Problem Summary:
I have been trying to add the highlight effect to my table but
everytime a new record is added the highlighting gives an rjs error.
However when i click the add to cart button on a product that already
exists inside the table, the highlight effect works. Is this because
the partial must only have only one <tr></tr> in it and the <table>
must be on the other
2006 Jul 03
2
Agile Web Dev on Rails - ActiveRecord::RecordNotFound Prob
Hi there
I''ve also made a start on the Agile Web Dev using Rails book! I''ve been
hit with a problem when hitting the ''Add to Cart'' button - I get the
following error message:
ActiveRecord::RecordNotFound in StoreController#add_to_cart
Couldn''t find Product without an ID
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full
2006 Aug 04
6
Errors ... errors and errors.
I bought the second edition of the ruby on rails, it seems to work fine
now, did some adjustments to the code. But now I get a second error and
I want to learn to understand to fix them myself. So here is the error.
ArgumentError in StoreController#add_to_cart
wrong number of arguments (1 for 0)
#{RAILS_ROOT}/app/models/cart.rb:15:in `initialize''
#{RAILS_ROOT}/app/models/cart.rb:15:in
2006 Jan 24
3
Unitialized constant
In Agile Web Development with Rails, I get this error when adding a
product to my cart:
uninitialized constant Cart
...
Application Trace:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/
active_support/dependencies.rb:200:in `const_missing''
./public/../config/../app/controllers/store_controller.rb:21:in
`find_cart''
2008 May 11
2
UnKnownAction exception
Hi all,
i''m new in ruby on rails.
i created a controller which has 2 views index, add_to_cart
& inside index i created "button_to" which references to add_to_cart
view, but when i click on this button UnKnownAction exception appear
to me, i don''t know why this happen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are