Displaying 9 results from an estimated 9 matches for "customer_control".
Did you mean:
customerscontrol
2011 Jun 09
3
Basic database question
Hi there
Yes, I know very little of ruby. I must take a crash course?
Probabily.
Anyway, I try to ask this here.
I have a control: customer_controller.
From here, I can do something like:
@id = 1
@customer = Customer.find(id)
Now @customer will contain all the fetched record for customer with id
= 1. Great.
From this controller I will render an html page. Somewhere the view
will print test. SOmething like:
"This is your account"...
2009 Feb 18
3
wrong number of arguments (1 for 0)
...f 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 Trace
app/controllers/customer_controller.rb:36:in `session''
app/controllers/customer_controller.rb:36:in `add_to_cart''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My controller is ...
def add_to_cart
if request.post?
product_id = params[:product_id]
quantity = params[:quantit...
2006 May 25
7
Grouping controllers
...ouping controllers to avoid cluttering the top-level namespace.
First, I used script/generate Admin::Customers new edit show list and then I
used
script/generate Admin::Providers new edit show list.
The generator created the subfolders correctly: I have an admin folder and
inside there''s customer_controller.rb and provider_controller.rb.
I have the same structure in views. BUT when I go to
http://localhost:3004/admin/customer/list I get an Unknown Action error. I''m
positive that the action is declared in the respective controller. Am I
missing something?
I read about this on the Agile We...
2012 Feb 08
2
Session values
Hello Everyone,
I am new to Ruby. My application revolves around the user having a
"Customer" object and having that customer id in the session. Right now
I have a customer service which creates the customer or finds one that
has been created and adds the id to the session. However, I can''t
guarantee that the customer service will be the first one hit when my
application
2005 Nov 16
4
What happened to mysql connection?
...active_record/base.rb:930:in `construct_finder_sql''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/base.rb:411:in `find''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/
active_record/base.rb:409:in `find''
#{RAILS_ROOT}app/controllers/customer_controller.rb:13:in `pre_check''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:354:in `send''
/opt/local/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/
action_controller/filters.rb:354:in `call_filters''
/opt/local/lib/ruby/gems/1.8/gems/acti...
2006 Jan 04
7
recongizing the current controller in views
alright i am doing a simple self blog in ruby. Now iw ant to be able to
determine which controller action i am in inside _form.rhtml.
So if i am in new or the creation control than i want to insert the text box
for topics else i want to display the topic base on id. (i could do those
already, i just need help finding the right if statement..
something like (if currentpage ==
2006 Sep 30
6
generating unique tracking numbers
...so I just increment the max value of the
id column. Here''s how I generate a customer number:
application.rb:
CUSTOMER_BASE = "10000"
def next_id(table_name, column)
ActiveRecord::Base.connection.select_value("select max(#{column})+1
from #{table_name}")
end
customer_controller.rb:
def create
@customer.number = CUSTOMER_BASE.to_i + next_id(''customers'',
''id'').to_i
end
Have I simply postponed the problem to the day when ids have been
re-organized beyond the customer_base and I start generating
collisions?
So what do you do?? I...
2007 Dec 13
3
Realise a web service with ruby on rails.
...two elements.
I did a model customer, a web_service customer.
In the file /app/apis/customer_api.rb
class CustomerApi < ActionWebService::API::Base
api_method :listid, :expects => [:int], :returns => [Customer]
api_method :listall, :returns => [[:int]]
In the file /app/controller/customer_controller.rb
class CustomerController < ApplicationController
wsdl_service_name ''Customer''
web_service_scaffold :invoke
def listid(id)
Customer.find(id)
end
def listall
Customer.find(:all).map{ |customer| customer.id }
end
end
I finished my server web_service....
2006 Jan 13
19
Problems with scaffold''s parameter on Oracle
Hi
I run Ruby on Rails on Oracle XE.
I have a simple table:
create table customer(id number primary key, name varchar2(100));
And
ruby script\generate model Customer
ruby script\generate controller Customer
http://localhost:3000/customer/
- show a fine list, but when I click show/edit/destroy, I get an
ORA-01722:
OCIError: ORA-01722: invalid number: select * from (select raw_sql_.*,