Official API of the framework. Provides an explanation of every class and functionality.
Link: api.rubyonrails.org
<%= button_to "New", action: "new" %> # => "<form method="post" action="/controller/new" class="button_to"> # <div><input value="New" type="submit" /></div> # </form>" <%= button_to [:make_happy, @user] do %> Make happy <strong><%= @user.name %></strong> <% end %> # => "<form method="...
Reflection enables to interrogate Active Record classes and objects about their associations and aggregations. This information can, for example, be used in a form builder that takes an Active Record object and creates input fields for all of the attributes depending on their type and...
Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks by including a token in the rendered html for your application. This token is stored as a random string in the session, to which an attacker does not have access. When a request reaches your application, R...
If your object is already designed to implement all of the Active Model you can use the default :to_model implementation, which simply returns self. If your model does not act like an Active Model object, then you should define :to_model yourself returning a proxy object that wraps yo...
It provides an interface for protecting attributes from end-user assignment. This makes Action Controller parameters forbidden to be used in Active Model mass assignment until they have been whitelisted.
Action caching is similar to page caching by the fact that the entire output of the response is cached, but unlike page caching, every request still goes through Action Pack. The key benefit of this is that filters run before the cache is served, which allows for authentication and ot...
Creates a button element that defines a submit button, reset button or a generic button which can be used in JavaScript, for example. You can use the button tag as a regular submit tag but it isn't supported in legacy browsers. However, the button tag allows richer labels such as imag...
Observers will by default be mapped to the class with which they share a name. So CommentObserver will be tied to observing Comment, ProductManagerObserver to ProductManager, and so on. If you want to name your observer differently than the class you’re interested in observing, you ca...