[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-15 Thread Kalpesh Patel
Hi Matt, Actually I am trying to connect to already existing DB where mentioned table is readily available. I just need to read it all the time or occasionally write it but I do not create it from my app. The primary key of the table is varchar. I can do nothing about that and if i do not declare

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-14 Thread Matt Jones
Somewhat unrelated, but if you're creating a new, "simple" Rails app, why are you tangling with set_table_name and a noninteger primary key? Working against the Rails conventions will cause no end of trouble, especially if you're just starting out... --Matt Jones On Nov 13, 4:00 am, Kalpesh1 Pat

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Kalpesh1 Patel
Leonardo Mateo wrote: > On Fri, Nov 13, 2009 at 10:39 AM, Kalpesh1 Patel > wrote: when callback method is called? >>> >>> Callbacks like before_create can't take any arguments >>> >>> Fred >> >> So isn't there any way I can pass some value from controller to model? > What do you mean? Of cou

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Kalpesh1 Patel
Sijo k g wrote: > Hi Kalpesh1 Patel > >> So isn't there any way I can pass some value from controller to model? > > You can define cname as n attr_writer in model and can set its value > from controller like @simple.cname = 'namehere' > > > Sijo Thanks sijo! I am able to get/set it using

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Leonardo Mateo
On Fri, Nov 13, 2009 at 10:39 AM, Kalpesh1 Patel wrote: > > Frederick Cheung wrote: >> On Nov 13, 9:00�am, Kalpesh1 Patel >> wrote: >> >>> When I run this in browser, it throws error "Wrong number of arguments >>> (0 for 1)". Obviously, my method "init_name" expects one parameter and >>> it does

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Sijo k g
Hi Kalpesh1 Patel > So isn't there any way I can pass some value from controller to model? You can define cname as n attr_writer in model and can set its value from controller like @simple.cname = 'namehere' Sijo -- Posted via http://www.ruby-forum.com/. --~--~-~--~~---

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Kalpesh1 Patel
Frederick Cheung wrote: > On Nov 13, 9:00�am, Kalpesh1 Patel > wrote: > >> When I run this in browser, it throws error "Wrong number of arguments >> (0 for 1)". Obviously, my method "init_name" expects one parameter and >> it doesn't find any while called(by controller??). Basically I want to >>

[Rails] Re: Wrong number of arguments (0 for 1) in callback method

2009-11-13 Thread Frederick Cheung
On Nov 13, 9:00 am, Kalpesh1 Patel wrote: > When I run this in browser, it throws error "Wrong number of arguments > (0 for 1)". Obviously, my method "init_name" expects one parameter and > it doesn't find any while called(by controller??). Basically I want to > send this 'cname' variable from

[Rails] Re: wrong number of arguments (0 for 1) in []

2009-07-03 Thread Matt Jones
On Jul 3, 12:33 am, JannaB wrote: > I am creating a multiple-selection list box with : > >  <% form__list1 = [] %> > <%= select_tag, options_for_select(["A","B","C","D"], selected ="A"), > html_options = {"size" => 5, "multiple" => true}) %> > I'm not sure what the error that you're getting is

[Rails] Re: wrong number of arguments (0 for 1) in []

2009-07-03 Thread Colin Law
2009/7/3 JannaB : > > I am creating a multiple-selection list box with : > >  <% form__list1 = [] %> > <%= select_tag, options_for_select(["A","B","C","D"], selected ="A"), > html_options = {"size" => 5, "multiple" => true}) %> > > I get > wrong number of arguments (0 for 1) > alluding to form__li