search for: orderscontroller

Displaying 9 results from an estimated 9 matches for "orderscontroller".

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 include a count of line_items per order, and to include it as say total_line_items in the output. I don''t know how to a.) get the count per order, b.) how to i...
2007 Dec 12
1
why is authenticate_with_http_basic undefined?
...01. def must_authenticate if @authenticated_user && (@user_is_viewing_themselves != false) return true else request_http_basic_authentication return false end end I get a NOMETHODERROR undefined method `request_http_basic_authentication'' for #<OrdersController:0x478cc5c> when i tried this url http://localhost:3001/v1/users/permalink_for_user_1/orders if i remove the filter , etc i can use this link which is of course bad cause i also can see teh data when i am not the authenticated user. Please help. Thank you --~--~---------~--~----~------------~...
2010 Dec 31
1
WickedPDF - wrong number of arguments
...''m trying to get this plugin to work for me. I''m having the following issue when I try to render a pdf (/fancy_things/45.pdf ).. Any suggestions? Thanks! ERROR: Started GET "/fancy_things/45.pdf" for 192.168.66.1 at Fri Dec 31 10:59:07 -0500 2010 Processing by OrdersController#show as PDF Parameters: {"id"=>"45"} ***************WICKED*************** Completed in 4ms ArgumentError (wrong number of arguments (1 for 0)): app/controllers/orders_controller.rb:20 app/controllers/orders_controller.rb:9:in `show'' Rendered /usr/lib/ruby/g...
2006 Jan 06
6
HABTM problem not saving all associations
...n_type.id %>" value="<%= loan_type.id %>" <% if @order.loan_types.include? loan_type %> checked="checked"<% end %> > <%= loan_type.name %> </label><br/> <% end %> </fieldset> chunk of log/development.log: Processing OrdersController#create (for 127.0.0.1 at 2006-01-05 13:15:11) [POST] Parameters: {"commit"=>"Create", "product_ids"=>["1", "2", "3"], "loan_type_ids"=>["1", "2", "4"], "order"=>{"city&qu...
2009 Jul 09
0
Cache expiration with format not working as expected
Hi all, In my OrdersController, I have two actions completed and incomplete that respond_to HTML and CSV. Im also action caching these actions .. caches_action :completed, :incomplete ... def completed @orders = Order.completed respond_to do |format| format.html format.csv {render :layout => false} end...
2006 Jul 13
6
Render partial questions
Hello, what is the preferred way to do this... I have 2 controllers. Each has an index action. Now I want to include the rendered index view from TwoController in the index view of OneController. But a render :partial doesn''t execute the TwoController index action which sets variables for its index view. So maybe you can give me a short example how to do it. Thank you Markus
2007 Dec 04
12
params not available for controller specs?
Hi, all, I''m trying to write a spec for a controller method that starts out: def download @orders = Order.find( params[:ids] ) ... and started writing a spec that set params[:ids] to a mock. I was surprised to discover that controller specs (at least in RSpec 1.0.8) don''t offer the use of the params object (per
2010 Feb 22
9
Couldn't find Order with ID=pending_orders
I have a Controller named Orders which has a pending_orders method which is expected to fetch some records from the database. If i dont write a route for this method, I get the following error when i call this method. Couldn''t find Order with ID=pending_orders I am using rails 2.3.5, in the previous versions i use to get this I am not getting whether its new version requirement... Help
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a terrible time getting the models set up correctly. I have an order table that has a primary field named order_number. I have a name table with a primary of item_number. These two tables are liked by the item_number and the order_number, but not as you might think. If the order_number is 2500, then each entry in