Vojto
2009-Jun-06 11:17 UTC
How does controller call render when there''s no render in action
Hello, I was studying Rails source and at this point: def process(request, response, method = :perform_action, *arguments) #:nodoc: response.request = request initialize_template_class(response) assign_shortcuts(request, response) initialize_current_url assign_names log_processing send(method, *arguments) send_response I have a question. "send(method, *arguments)" this calls action of a controller, right? But if there''s no ''render'' in action - how does it automatically call render and renders the template for the action? Thanks a lot
Frederick Cheung
2009-Jun-06 13:01 UTC
Re: How does controller call render when there''s no render in action
On Jun 6, 12:17 pm, Vojto <zero0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a question. > > "send(method, *arguments)" this calls action of a controller, right?not quite - (at least in the common) case, the method that gets called is perform_action, which calls default_render if you have not called render. Fred> But if there''s no ''render'' in action - how does it automatically call > render and renders the template for the action? > > Thanks a lot
Vojto
2009-Jun-07 12:13 UTC
Re: How does controller call render when there''s no render in action
Sweet, so I totally missed perform_action method :) Thanks :) On Jun 6, 3:01 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jun 6, 12:17 pm, Vojto <zero0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have a question. > > > "send(method, *arguments)" this calls action of a controller, right? > > not quite - (at least in the common) case, the method that gets called > is perform_action, which calls default_render if you have not called > render. > > Fred > > > > > But if there''s no ''render'' in action - how does it automatically call > > render and renders the template for the action? > > > Thanks a lot
Maybe Matching Threads
- [CruiseControl] RubyOnRails build 8671 failed
- ArgumentError in Main#index, weirdness.
- respond_with with templates and http status when creating an object
- ActionMailer in an infinite loop? Looks like framework bug.
- Error: "wrong number of arguments" in initialize_template_class