Trt Trt
Trt Trt

Reputation: 5532

Rails 3 Controller do not render page

Is it possible in rails 3 to have a link pointing to a controller action, but not render anything? Let's say I just want to call a couple rake tasks. Is this possible?

Upvotes: 1

Views: 1198

Answers (2)

Erez Rabih
Erez Rabih

Reputation: 15788

You can render nothing by using:

render :nothing => true

At the end of your action in the controller.

Upvotes: 8

Flo
Flo

Reputation: 540

Call the method and add at the end of it a redirect_to or render to a site you want to view. Don't forget to add this to your routes. You can also use flash messages to show to the user that something happend :)

Upvotes: 0

Related Questions