An overview of some of the new features in Rails 4. All features are discussed in depth in the e-book Upgrade to Rails 4 (http://www.leanpub.com/upgradetorails4) as well.
that a parameter is present. If it’s present, returns the parameter at the given key, otherwise raises an ActionController:: ParameterMissing error. permit(filters) - Returns a new ActionController::Parameters instance that includes only the given filters and sets the permitted attribute for the object to true. This is useful for limiting which attributes should be allowed for mass updating.
def create @contact = Contact.new(params[:contact]) if @contact.valid? UserMailer.new_contact(@contact).deliver redirect_to root_path, notice: "Message sent! Thanks.” else render :new end end end
ENCRYPTED COOKIES ROUTING CONCERNS HTTP PATCH VERB CUSTOM FLASH TYPES HTML5 FORM HELPERS SCHEMA CACHE DUMP NO MORE OBSERVERS/SWEEPERS INDEX PAGE CONTROLLER ACTIVE RESOURCE PAGE/ACTION CACHING