search for: productscontroller

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

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 email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe fro...
2007 Oct 23
6
Problem Upgrading from 1.0.5 to 1.0.8
Hey Guys, I''m getting the following error: 1) NameError in ''ProductsController with a GET to /products NO NAME (Because of Error raised in matcher)'' uninitialized constant Spec::Mocks::BaseExpectation::AnyArgsConstraint /Users/mattlins/Projects/RailsProjects/SWNetworkServices/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/render_observer.rb:86:in `expec...
2006 Jul 07
2
Get controller''s module path
Hi, Given a controller such as Maintenance::ProductsController, is there a way to obtain the module section ''Maintenance'' within a view. I am planning to highlight the maintenance option from a common menu whenever a controller from the Maintenance module is used. Thanks, Andrew. -- Posted via http://www.ruby-forum.com/.
2006 May 11
2
Reuse code
Hi, I have several helper methods that I use on one view . Is there a way to share this methods on several views ? To be more specific in: companies_helper I''ve defined the helper methods that I would like to use in products section. Thanx, Ovidiu
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 fixtures :products, :categories def setup @controller = ProductsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new...
2009 Jun 26
1
rSpec Newbie Question - Testing controller
Hi I am very new to rspec and would like to learn more. I have googled around and asked in irc with no firm answers. I have the following controller : class ProductsController < ApplicationController before_filter :loadsidebar def show @category = Category.find(params[:id]) @products = @category.products end private def loadsidebar @categories = Category.find(:all) end end rCov reports that the code in the sh...
2005 Aug 18
1
Auto Complete, works as adverrtised?
I''m trying to use the auto complete now and I get: undefined method `auto_complete_for'' for #<ProductsController:0x40a44338> My code is: def auto auto_complete_for :product, :title end Just like in the "view source" div from the demo. Well, almost like it. Am I missing .rb library somewhere? thanks Jacob
2005 Dec 28
3
Module loading
...9;'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? -- Posted via http://www.ruby-forum.com/.
2007 Dec 22
8
Rails 2.0 scaffold
Hey guys, I posted the other day about scaffold not working and i was told that it was rails 2.0 doing this. (btw i''m using adgile web development) I have read on the internet that you need to put extra stuff like title, description...... So i did this: C:\ruby\depot>ruby script\generate scaffold Product Admin id:int title:varchar(1 00) description:text image_url:varchar(200)
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
2006 Jul 24
1
meantime_filter won''t pick up my missing methods
..._to_user'', ''scope_messages_to_mailbox'', etc. The problem is meantime_filter isn''t running my method_missing method. <code><pre> meantime_filter :scope_products_to_user #=> NameError: undefined method `scope_products_to_user'' for class `ProductsController'' </pre></code> I can only seem to run the methods from the controller. <code><pre> meantime_filter :scope_products_to_user_temp def scope_products_to_user_temp scope_products_to_user { yield } end </pre></code> This works fine. I think the problem...
2009 Sep 29
0
Problem with RESTful resource and ActiveScaffold
...tes look like: map.register "register", :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.resour...
2011 Oct 24
1
JQuery autocomplete example
...uery-autocomplete) for building an autocomplete and ran into a small set of problems. I''m not using the exact names of models, but I suppose I could. It''s just a dummy set. For me: Model is Package and attribute is Brand. I don''t understand what the reference to class ProductsController < Admin::BaseController has to do with anything relevant. Typically Controllers inherit from ApplicationController. Why this is different it not explained. but once I get past this... I just did it anyways. It doesn''t do anything. There''s no callbacks to the server, no da...
2011 Feb 09
4
Modules being shared and model data
...cing attr_accessible :company_id, :allocated_product_id, :quantity, :saledate, :cost belongs_to :company belongs_to :allocated_product, :class_name => ''Product'' #So you have company.products and company.allocated_products. end A products and allocations controller: class ProductsController < ApplicationController def index @products = Product.all end class AllocationsController < ApplicationController def index @products =Product.all @allocations = Allocation.all end And the views in product index: <td><%=h (sprintf( "R%.02f" ,pro...
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:
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
...; :get } # Sample resource route with 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 => &...
2007 Dec 27
17
2.0 & "Agile Web Dev..." book
Just running through the first little project (depot) in ''Agile Web Development with Rails''. It isn''t scaffolding like it says it should in the book. After running: >rails -d mysql depot then SQLing: drop table if exists products; create table products ( id int not null auto_increment, title varchar(100) not null, description text not null, image_url varchar(200)
2012 May 11
14
What is the point of using :format in routes?
Today I had a strange behavior that made me suspect of jQuery at first, but then it happened that I''ve faced two gotchas, one from CoffeeScript and one from Rails itself. I have something like this: routes.rb post ''/fields/:id.:format'' => ''fields#show'', as: :field, constraints: {id: /\d+/} post ''/fields/remove/:id''
2007 Sep 07
12
Preconditions
Sorry, lots of questions these days. Is there a normal approach for preconditions? In JUnit, I might put a few assertions in the setUp() just to make sure that the test ''data'' I''ve created meets expectations before going to test it. So, for instance, I''ve got an object that is audited using acts_as_audited and I''d like to test the XML that results