search for: products_controller

Displaying 20 results from an estimated 21 matches for "products_controller".

2012 Mar 17
8
Agile web development with rails 4th edition adding sizes to the product
Hi I am going through the Agile web development with rails 4th edition book and I am trying to modify the depot application to allow the customer to select a size before purchasing a product. What and how would I have to modify the depot app to do this? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my products_controller: require File.dirname(__FILE__) + ''/../test_helper'' require ''products_controller'' # Re-raise errors caught by the controller. class ProductsController def rescue_action(e) raise e end end class ProductsControllerTest < Test::Unit::TestCase fixtu...
2006 Mar 22
2
What is wrong in this method??????
...or is:- ========================= C:/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1333:in `attributes='' C:/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1266:in `update_attributes'' #{RAILS_ROOT}/app/controllers/products_controller.rb:15:in `add_to_cart'' -e:3 ========================= What is wrong in above method? Please tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
2005 Dec 28
3
Module loading
...'ve looked high and low for the answer to this and can''t seem to find anything that helps. I have an admin section (much like Typo) where all controllers are based on the Admin::BaseController. My directory structure is [RAILS] -app --controllers ---admin ----base_controller.rb ----products_controller.rb Products controller is: class Admin::ProductsController < Admin::BaseController end base_controller.rb is: class Admin::BaseController end However I keep getting this error: NameError: Cannot load module Admin: Object::Admin is set to Admin Can anyone help me out with this, please? -- P...
2006 Mar 29
3
Grouping Controllers into Modules - Doesn''t work!?
Ok, what I want to achieve is: http://<mydomain>/admin/products calls app/controllers/admin/products_controller.rb According to Agile Development with Rails this should work. I executed the follwing commands: rails myproj cd myproj script/generate controller Admin script/generate scaffold Admin::Product this creates app/controllers/admin/products_controller.rb all the views & Product model, but does...
2006 Mar 17
1
How to update values in database in this form?
...n_field ''product'',''count'', :value=>i.to_i-1%></td> <td colspan=4 align="center"> <%= submit_tag("Add to Cart") %> </td> </tr> </table> <%= end_form_tag %> ================================== ======products_controller.rb======= def add_to_cart count=params[:product][:count] while count.to_i>=0.to_i @product = Product.find(params[:product][''product_id''+count.to_s]) print "pppp" + params[:product][''dem_quantity''+count.to_s] if params[:pro...
2010 Mar 11
3
Bypassing automatic STI generation
Hi, Let''s say I have the following: Product < AR Memberships < Product I know that the product with id 10 has its type column set to "Membership", but still I''d like to treat it as a regular product. So if I do: Product.find(10), Rails returns a Membership object. Is it possible to tell rails to not care about STI and to simply return a Product object?
2006 Jun 30
2
how to HABTM with STI ??
...has_and_belongs_to_many :products end class Part < Item end class Accessory < Item end I have created part and accessory controllers/crud views and have attempted to do the following but it doesn''t appear that the HABTM relationship is in place. >From the products_controller I attempt the following: #populate collections for _partials @parts = @product.parts.find_all @accessories = @product.accessories.find_all But get the following error. Undefined method `parts'' Any suggestions? Regards, Adam ------------sql script...
2008 May 04
5
simple Routing Error
Routing Error No route matches "/user/register" with {:method=>:get} The URL is http://localhost:3000/user/register Here is app/views/user/register.rhtml <h2>Register</h2> <% form_for :user do |form| %> <fieldset> <legend>Enter Your Details</legend> <div class="form_row"> <label
2008 Aug 20
0
Re: Help with RoR partial views
Your partial uses a simple form_for(@product) call. By default that will do a POST to the products/create action, which if it''s successful, does a redirect to products/show/<<id for the new product>> (see the create method in your products_controller.rb file). My advice is to just play around w/rails for a bit & get used to its conventions before you try to bend it to your will. ;-) HTH, -Roy -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk@googlegroups.com] On Behalf Of...
2009 Sep 29
0
Problem with RESTful resource and ActiveScaffold
...r", :controller => "users", :action => "create" map.resources :users map.resources :user_sessions # Sample resource route within a namespace: map.namespace :admin do |admin| # Directs /admin/products/* to Admin::ProductsController (app/ controllers/admin/products_controller.rb) # map.resources :admins, :active_scaffold => true, :has_many => [:events] admin.resources :users, :active_scaffold => true, :has_many => [:events] admin.resources :contracts, :active_scaffold => true admin.resources :houses, :active_scaffold => true,...
2005 Sep 26
1
[Fwd: [Rails] Re: Autocomplete - setting a second value?]
...e_for_supplier_name.rhtml: <ul> <%= render :partial => ''supplier'', :collection => @suppliers %> </ul> app/views/products/_supplier.rhtml: <li id="s<%= supplier.id %>"><%= h(supplier.display_name) %></li> app/controllers/products_controller.rb: def auto_complete_for_supplier_name name = "%#{params[:supplier][:name].downcase}%" conditions = [] values = [] conditions << ''destroyed_at is null'' conditions << ''supplier = 1'' conditions << ''(company_n...
2006 Dec 18
3
Creating another database connection for large mysql import?
I''m using backgroundrb to periodically download a large file via ftp from a remote location and then import it into the database. To perform the import, I was using the following: ActiveRecord::Base.connection.execute(%{load data infile ...;}) although on a file with 2.5 million records, this can take 5 minutes, which seems to tie up my rails application while this executes (even
2010 Mar 09
1
Ruby 1.9 and Searchlogic problem
...hlogic/search.rb:50:in `initialize'' /usr/local/lib/ruby/gems/1.9.1/gems/searchlogic-2.3.11/lib/searchlogic/search.rb:25:in `new'' /usr/local/lib/ruby/gems/1.9.1/gems/searchlogic-2.3.11/lib/searchlogic/search.rb:25:in `searchlogic'' /home/dries/Projects/cloud/app/controllers/products_controller.rb:62:in `get_menu_items'' Line 62 in product controller: product_type_search = ProductType.searchlogic(:products_active => true, :products_on_sale => true, :products_available_for_gallery => true) Somebody who knows why this problem occurs? Therefore it was working great with...
2011 Sep 21
5
problem with submit button in rails 3
hi, i am using <%= s.submit ''Product save'' %> when i click it, following error appears " Routing Error uninitialized constant ProductsController" could any one provide me solution ? thanks, -pab -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2006 Nov 30
3
Strange send_file problem
...tyle="display: none;"> <pre><code>/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:840:in `redirect_to'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:854:in `redirect_to'' app/controllers/products_controller.rb:167:in `download_vbj_product'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in `perform_action_without_filters'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Gr...
2005 Sep 22
6
Autocomplete - setting a second value?
I''m using the autocomplete function, and need a way to grab a second value from the ajax request... an example would probably speak better: This is my HTML: <input name="CustomerName" id="CustomerName" type="text" /> <div id="CustomerList"></div> <input name="CustomerID" id="CustomerID"
2011 May 07
11
changing routes.rb
Hi, I''m a complete beginner and I just have a simple question: How do I change lines in a file like routes.rb? I know the command type (i.e type config\routes.rb) but that just shows it and doesn''t allow me to change anything. Thanks in advance -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby
2011 May 19
0
Unable to find the image path via file system using the paperclip plugin through the get method
...th sub-resources: # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller # Sample resource route within a namespace: # map.namespace :admin do |admin| # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) # admin.resources :products # end # You can have the root of your site routed with map.root -- just remember to delete public/index.html. # map.root :controller => "welcome" map.root :controller => "posts" # See how all your...
2009 Sep 12
5
undefined method `^' for "d":String
....1/gems/actionpack-2.3.4/lib/ action_controller/flash.rb:163:in `flash'' C:1:in `flash'' C:/lfalcao/Work/Dev/Ruby/Rails/Depot/app/views/layouts/ products.html.erb:12:in `_run_erb_app47views47layouts47products46html46erb'' C:/lfalcao/Work/Dev/Ruby/Rails/Depot/app/controllers/ products_controller.rb:7:in `index'' ------------------------------------------------------------------------------------------------------------------------ This is the default view generated. I haven''t touched it yet. What is this problem? Do I need to install something else? Am I doing anything wr...