Re: [Rails] Re: Two controllers with create using the same model

2010-04-03 Thread Colin Law
On 2 April 2010 22:10, WSzP c...@ctdd.ro wrote: Thanks a lot Colin, First of all, I'm using Rails 2.3.5. and Ruby 1.8.7. The generated HTML looks like this: form method=post id=beiratkozok action=/beiratkozas The option suggested by you: % form_for :student, @student, :url = {:controller =

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
Any ideas? I still can't find out why this does not work, or how to solve. Or you guys prefer pasting code into the email instead of http://pastie.org/899454 ? Thanks a lot. And Happy Easter! -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread DmitryPush
in your link I can see: beiratkozas_controller.rb subscriptions_controller.rb but where is students_controller.rb (StudentsController) ? Dose ruby asking you the same question?:) On Apr 2, 4:04 pm, WSzP c...@ctdd.ro wrote: Any ideas? I still can't find out why this does not work, or how to

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread DmitryPush
In addition, it happens because you using % form_for(@student) do | f| % helper if you look in HTML code (this helper appears to) you can find that request will be send to student controller... On Apr 2, 4:15 pm, DmitryPush dmitryp...@gmail.com wrote: in your link I can see:

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
Hello, Thanks a lot, and here is my students_controller.rb: http://pastie.org/900218 So I had one, but forgot to paste it to pastie. Peter -- 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

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread DmitryPush
so now we can see exactly what rails told you - it is now create method in student controller. :) and why you view requesting student controller i already told you. :) On Apr 2, 4:39 pm, WSzP c...@ctdd.ro wrote: Hello, Thanks a lot, and here is my students_controller.rb:http://pastie.org/900218

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
You got me wrong. I can't put the create method in the student controller. The question if, how could I use the create method from the BeiratkozasController class, while the model is NOT Beiratkozas, but Student. WSZP -- You received this message because you are subscribed to the Google Groups

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
You got me wrong. I can't put the create method in the student controller. The question if, how could I use the create method from the BeiratkozasController class, while the model is NOT Beiratkozas, but Student. WSZP -- You received this message because you are subscribed to the Google Groups

Re: [Rails] Re: Two controllers with create using the same model

2010-04-02 Thread Colin Law
On 2 April 2010 21:00, WSzP c...@ctdd.ro wrote: You got me wrong. I can't put the create method in the student controller. The question if, how could I use the create method from the BeiratkozasController class, while the model is NOT Beiratkozas, but Student. Have a look at the docs for

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
On Apr 2, 3:45 pm, DmitryPush dmitryp...@gmail.com wrote: so now we can see exactly what rails told you - it is now create method in student controller. :) and why you view requesting student controller i already told you. :) On Apr 2, 4:39 pm, WSzP c...@ctdd.ro wrote: Hello, Thanks a

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
Thanks a lot Colin, that was my problem. From documentation I managed to make a working form_for: % form_for :student, @student, :url = { :action = create }, :html = { :method = :post, :id = beiratkozok } do |f| % This works, but I don't understand why do I need the :student in the front.

Re: [Rails] Re: Two controllers with create using the same model

2010-04-02 Thread Colin Law
On 2 April 2010 21:21, WSzP c...@ctdd.ro wrote: Thanks a lot Colin, that was my problem. From documentation I managed to make a working form_for: % form_for :student, @student, :url = { :action = create }, :html = { :method = :post, :id = beiratkozok }   do |f| % This works, but I don't

[Rails] Re: Two controllers with create using the same model

2010-04-02 Thread WSzP
Thanks a lot Colin, First of all, I'm using Rails 2.3.5. and Ruby 1.8.7. The generated HTML looks like this: form method=post id=beiratkozok action=/beiratkozas The option suggested by you: % form_for :student, @student, :url = {:controller = 'beiratkozas', :action = create }, :html = { :method =