search for: customerscontrol

Displaying 11 results from an estimated 11 matches for "customerscontrol".

2009 Sep 09
4
undefined method `attr_accessor' for #<CustomersControl
pleas help -- Posted via http://www.ruby-forum.com/.
2006 Mar 28
1
Ajax callback to javascript array ?
I have some javascript, <script> var arrCustomers; function setCustomers(arr) { arrCustomers= arr; // arrCustomers holds now array of customers } </script> ... and Rails controller, class CustomersController < ApplicationController def list @customers = Customer.find_all end end ... and Ajaxed link to get the customers, <%= link_to_remote "Get customers", :url=>{ :controller=>"customers", :action=>"list", :complete=>&...
2006 Mar 31
7
problem with habtm conditions in pagination
...lf.up create_table :tags do |t| # t.column :name, :string end end def self.down drop_table :tags end end class Customer < ActiveRecord::Base has_and_belongs_to_many :tags end class Tag < ActiveRecord::Base has_and_belongs_to_many :customers end class CustomersController < ApplicationController def index list render :action => ''list'' end # GETs should be safe (see http://www.w3.org/2001/tag/doc/ whenToUseGet.html) verify :method => :post, :only => [ :destroy, :create, :update ], :redirect_to => {...
2007 Oct 24
7
NameError in CustomersController#index
I''m new to Rails. I finished the Cookbook tut. no problem. I''m trying to start a project of my own, follow the same instructions but the difference is I created the database myself. After I create the scaffolds and try them out I get this error NameError in CustomersController#index uninitialized constant Customer RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:266:in `load_missing_constant'' D:/InstantRails/ruby/lib/ruby/ge...
2006 Jul 24
4
Destroy action doesn''t work?
Hi all, Here is my Customer controller''s destroy method: ** def destroy Customer.find(params[:id]).destroy redirect_to :action => ''list'' end It''s stock, untouched scaffold code. When I submit the URL: http://localhost:3000/customers/destroy/11 The entry in the MySQL database with id 11 is not destroyed. The destroy method won''t
2009 Oct 02
0
Problems with validates_uniqueness_of
...idates_uniqueness_of :user ########################################## and when i run the application and want to add a diferent user from those are exist it work fine, bue when i want to add a user that is already add db it blow up and apears this : /////////////////////7777 ArgumentError in CustomersController#create too few arguments app/controllers/customers_controller.rb:71:in `format'' app/controllers/customers_controller.rb:71:in `create'' ////////////////////////77 ok so, what i found there was 70> flash[:notice] = ''Error!!!! intentelo de nuevo'' 71&g...
2006 Aug 02
1
REST and functional tests
Just playing around with converting an apps to the new REST goodness in edge rails, and I''m trying to work out how to convert/write the functional tests. Is the recommended way to explicitly use the actions (e.g. get :show, :id => ...; post :create,..., etc) and test the routes separately, or duplicate the request, in which case how is that done get "/", :id => 5
2011 Nov 22
4
A "strict Arel" mode for ActiveRecord to prevent SQL injection vulnerabilities
...opriate calls to register its literals at load time. For example, arel-2.2.1/lib/arel/expressions.rb would call, Arel.register_sql(''sum_id'', ‘max_id’, ….) In addition, application code itself could register literals at load time, to white-list custom statements, as in class CustomersController < ApplicationController Arel.register_sql {:customer_by_id => "name = ?"} def show @customer = Customer.where(:customer_by_id, params[:id]) Note that this effectively restricts the app to using only statements written in terms of bind variables, which is exactly what we want...
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2012 Jul 17
24
Static Pages from Railcast
Hi everyone, I need several pages to be static but also modify when requested. I try following the railcast from Ryan at http://railscasts.com/episodes/117-semi-static-pages?view=comments Here what I have done!! rails g scaffold Pages name:string permanentlink:string title:string author:string access_level:string is_published:boolean meta_description:string meta_keyword:string
2008 Jan 18
63
Jasper reports and iReport
Has anyone succeeded in producing Rails reports using jasper reports? I have prepared reports directly with Jasper''s iReport tool using my MySQL data. It is a very powerful reporting tool. The reports look greate. But I have not been able to produce the reports from my Rails application. I have followed the instructions provided at: