All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Break Versioning.
2.3.1 - 2025-12-06
-
Allow
handle_exceptionto receive multiple class names as strings. (@sidane in #495)class MyAction < Hanami::Action config.handle_exception( "MyException" => 500, "MyOtherException" => 501 ) end
2.3.0 - 2025-11-12
- Fetch CSRF tokens from
X-CSRF-Tokenrequest header, in addition to body params. (@masterT in #422)
-
Allow
config.handle_exceptionto receive an exception class name as a string. (@mathewdbutton in #488)This allows you to handle exceptions in your actions without having to require the Ruby files that define the exception constants, which is often awkward if those exceptions come from far-removed layers of your app.
class MyAction < Hanami::Action config.handle_exception "ROM::TupleCountMismatchError" => 404 end
-
Allow both
:unprocessable_entityand:unprocessable_contentand to be used to refer to the 422 HTTP status code (Rack v3 dropped the former and replaced it with the latter). (@alassek in #490)def handle(request, response) # Or :unprocessable_content, both work, on all Rack versions response.status = :unprocessable_entity end
2.3.0.beta2 - 2025-10-17
-
Make format config more flexible. (Tim Riley in #485)
Use
config.formats.registerto register a new format and its media types.This replaces
config.formats.add. Unlike.addit does not set the format as being one of the accpeted formats at the same time.This change makes it easier to
registeryour custom formats in app config or a base action class, without inadvertently causing format restrictions in descendent action classes.A simple registration looks like this:
config.formats.register(:json, "application/json")
.registeralso allows you to register one or more media types for the distinct stages of request processing:- If you want to accept requests based on different/additional media types in
Acceptrequest headers, provide them asaccept_types: - If you want to accept requests based on different/additional media types in
Content-Typerequest headers, provide them ascontent_types: - If you do not provide these options, then the default media type (the required second argument, after the format name) is used for each of the above
- This default media type is also set as the default
Content-Typeresponse header for requests that match the format
Together, these allow you to register a format like this:
config.formats.register( :jsonapi, "application/vnd.api+json", accept_types: ["application/vnd.api+json", "application/json"], content_types: ["application/vnd.api+json", "application/json"], )
Use
config.formats.acceptto accept specific formats from an action.formats.acceptreplacesAction.formatandconfig.format. You can access your accepted formats viaformats.accepted, which replacesconfig.formats.values.To accept a format:
config.formats.accept :html, :json config.formats.accepted # => [:html, :json] config.formats.accept :csv # it is additive config.formats.accepted # => [:html, :json, :csv]
The first format you give to
acceptwill also become the default format for responses from your action.Use config.formats.default=` to set an action's default format.
This is a new capability. Assign an action's default format using
config.formats.default=.The default format is used to set the response
Content-Typeheader when the request does not specify a format viaAccept.config.formats.accept :html, :json # When no default is already set, the first accepted format becomes default config.formats.default # => :html # But you can now configure this directly config.formats.default = :json
- If you want to accept requests based on different/additional media types in
Action.format,config.format,config.formats.add,config.formats.values, andconfig.formats.values=are deprecated and will be removed in Hanami 2.4. (Tim Riley in #485)- Drop support for Ruby 3.1. (Tim Riley in #485)
2.3.0.beta1 - 2025-10-03
- Add
Request#subdomains, returning an array of subdomains for the current host, andRequest#subdomainreturning a dot-delimited subdomain string for the current host. Addconfig.default_tld_lengthsetting for configuring the TLD length for your app's expected domain. (Wout in #481)
- Support Rack 3 in addition to Rack 2. (Kyle Plump, Tim Riley in #460)
request.sessionis now an instance ofHanami::Action::Request::Session, which wraps the session object and provides access to session values via symbol keys. This was previously handled via symbolizing and reassigning the entire session hash, which is not compatible with Rack 3. (Tim Riley in #477)
- Avoid false negatives in format/content type matches by checking against the request's media type, which excludes content type parameters (e.g. "test/plain" instead of "text/plain;charset=utf-8"). (wuarmin in #471)
2.2.0 - 2024-11-05
- When an action is called, add the action instance to the Rack environment under the
"hanami.action_instance"key. (Tom de Bruijn, Tim Riley in #446)
2.2.0.rc1 - 2024-10-29
2.2.0.beta2 - 2024-09-25
- Add support for using full dry-validation contracts for action param validation, via
Hanami::Action.contract. (Tim Riley, Krzysztof Piotrowski in #453, #454)
2.2.0.beta1 - 2024-07-16
- Drop support for Ruby 3.0. (Tim Riley in #454)
2.1.0 - 2024-02-27
2.1.0.rc3 - 2024-02-16
2.1.0.rc2 - 2023-11-08
2.1.0.rc1 - 2023-11-01
- Ensure Rack compatibility of
Hanami::Action::Response#send_file. (Luca Guidi in #431)
2.1.0.beta2 - 2023-10-04
Hanami::Action::Config#root: don't check realpath existence to simplify the boot process of Hanami. (Luca Guidi in #429)
2.1.0.beta1 - 2023-06-29
- Add
Request#session_enabled?andResponse#session_enabled?. (Tim Riley in #423)
2.0.2 - 2023-02-01
- Params Pattern Matching. (Adam Lassek in #417)
- Allow to
haltusing aSymbol:halt :unauthorized. (Adam Lassek, Luca Guidi in #418) - Introduce
Hanami::Action::Response#status=to accept anIntegeror aSymbol. (Adam Lassek, Luca Guidi in #418)
- Ensure action accepting the request with a custom MIME Type. (Pat Allan in #409)
- Halting with an unknown HTTP code will raise a
Hanami::Action::UnknownHttpStatusError. (Luca Guidi in #418) - Fix error message for missing format (MIME Type). (Luca Guidi in #418)
2.0.1 - 2022-12-25
- Official support for Ruby 3.2. (Luca Guidi in #408)
2.0.0 - 2022-11-22
- Use Zeitwerk to autoload the gem. (Tim Riley in #401)
- Introduce
Hanami::Action::Config#formats. Useconfig.actions.formats.add(:json). Custom formats can useconfig.actions.formats.add(:graphql, ["application/graphql"]). (Tim Riley in #401)
- Changed
Hanami::Action::Config#formatsemantic: it's no longer used to add custom MIME Types, but as a macro to setup the wanted format for action(s). (Tim Riley in #401) - Removed
Hanami::Action::Config#default_request_formatand#default_response_format, use#formatfor both. (Tim Riley in #401) - Removed
Hanami::Action::Config#accept, use#format. (Tim Riley in #401)
2.0.0.rc1 - 2022-11-08
- Simplify assignment of response format:
response.format = :json(wasresponse.format = format(:json)). (Tim Riley in #400)
2.0.0.beta4 - 2022-10-24
- Add
Response#flash, and delgate to request object for bothResponse#sessionandResponse#flash, ensuring the same objects are used when accessed via either request or response. (Tim Riley in #399)
- When
Action.acceptis declared (orAction::Config.accepted_formatsconfigured), return a 406 error if anAcceptrequest header is present but is not acceptable. In the absence of anAcceptheader, return a 415 error if aContent-Typeheader is present but not acceptable. If neither header is provided, accept the request. (Tim Riley in #396) - Add
Action.handle_exceptionclass method as a shortcut forHanami::Action::Config#handle_exception. (Tim Riley in #394) - Significantly reduce memory usage by leveraging recent dry-configurable changes, and relocating
accepted_formats,before_callbacks,after_callbacksinheritable attributes toconfig. (Tim Riley in #392) - Make params validation schemas (defined in
params doblock) inheritable to subclasses. (Tim Riley in #394) - Raise
Hanami::Action::MissingSessionErrorwith a friendly message ifRequest#session,Request#flash,Response#sessionorResponse#flashare called for an action that does not already includeHanami::Action:Sessionmixin. (Benhamin Klotz, Tim Riley in #379, #395)
- When a params validation schema is provided (in a
params doblock), only return the validated params fromrequest.params. (Benjamin Klotz in #375) - Handle dry-schema's messages hash now being frozen by default. (Sean Collins in #391)
2.0.0.beta1 - 2022-07-20
- Using
Hanami::Action.paramswithout havinghanami-validationsinstalled now returns a user-friendly error. (Benjamin Klotz in #371) - Ensure HEAD responses to send empty body, but preserve headers. (Narinda Reeders in #368)
- Ensure HEAD redirect responses to return redirect headers. (Narinda Reeders in #368)
- Do not automatically render halted requests. (Andrew Croome in #364)
2.0.0.alpha8 - 2022-02-19
- Removed automatic integration of
Hanami::Actionsubclasses with their surrounding Hanami application. Action base classes within Hanami apps should inherit fromHanami::Application::Actioninstead. (Tim Riley in #362)
2.0.0.alpha6 - 2022-02-10
- Official support for Ruby: MRI 3.1. (Luca Guidi in #359)
- Drop support for Ruby: MRI 2.6, and 2.7. (Luca Guidi in #359)
- Align with Rack list of HTTP supported status. Added:
103,306,421,425,451, and509. Removed:418,420,444,449,450,451,499,598,599. (Sean Collins in #358)
2.0.0.alpha5 - 2022-01-12
- Added "rss" ("application/rss+xml") to list of supported MIME types. (Philip Arndt in #357)
2.0.0.alpha4 - 2021-12-07
- Manage Content Security Policy (CSP) defaults and new API via
Hanami::Action::ApplicationConfiguration#content_security_policy. (Luca Guidi in #354) - Provide access to routes inside all application actions via
Hanami::Action::ApplicationAction#routes. (Tim Riley & Marc Busqué in #352)
2.0.0.alpha3 - 2021-11-09
- Automatically include session behavior in
Hanami::Actionwhen sessions are enabled via Hanami application config. (Luca Guidi in #347) - Pass exposures from action to view. (Sean Collins in #348)
- (Internal) Updated settings to use updated
settingAPI in dry-configurable 0.13.0. (Tim Riley in #346) - Move automatic view rendering from
handletofinish. (Sean Collins in #348)
2.0.0.alpha2 - 2021-05-04
- Official support for Ruby: MRI 3.0. (Luca Guidi in #325)
- Introduced
Hanami::Action::ApplicationAction. (Tim Riley in #325) - Introduced
Hanami::Action::Configuration. (Tim Riley in #325) - Introduced
Hanami::Action::ApplicationConfiguration. (Tim Riley in #325) - Auto-inject a paired view into any
Hanami::Action::ApplicationActioninstance. (Tim Riley in #325) - Auto-render
Hanami::Action::ApplicationActionsubclasses that don't implement#handle. (Tim Riley in #325) - Enable CSRF protection automatically when HTTP sessions are enabled. (Tim Riley in #325)
- Drop support for Ruby: MRI 2.5. (Luca Guidi in #325)
- Removed
Hanami::Action.handle_exceptionin favor ofHanami::Action.config.handle_exception. (Tim Riley in #325) - Rewritten
Hanami::Action::Flash, based on Roda'sFlashHash. (Tim Riley in #325)
- Ensure
Hanami::Action::Response#renderable?to returnfalsewhen body is set. (Luca Guidi in #325) - Ensure
Hanami::Action.acceptto use RackCONTENT_TYPEfor the before callback check. (Andrew Croome in #325)
2.0.0.alpha1 - 2019-01-30
Hanami::Action::Request#sessionto access the HTTP session as it was originally sent. (Luca Guidi in #281)Hanami::Action::Request#cookiesto access the HTTP cookies as they were originally sent. (Luca Guidi in #281)- Allow to build a deep inheritance chain for actions. (Luca Guidi & Tim Riley in #281)
- Drop support for Ruby: MRI 2.3, and 2.4. (Luca Guidi in #281)
Hanami::Actionis a superclass. (Luca Guidi in #281)Hanami::Action#initializerequires aconfiguration:keyword argument. (Luca Guidi in #281)Hanami::Action#initializereturns a frozen action instance. (Luca Guidi in #281)Hanami::Actionsubclasses must implement#handleinstead of#call. (Tim Riley in #281)Hanami::Action#handleacceptsHanami::Action::RequestandHanami::Action::Response. (Luca Guidi in #281)Hanami::Action#handlereturnsHanami::Action::Response. (Luca Guidi in #281)- Removed
Hanami::Controller.configure,.configuration,.duplicate, and.load!. (Luca Guidi in #281) - Removed
Hanami::Action.useto mount Rack middleware at the action level. (Luca Guidi in #281) Hanami::Controller::Configurationchanged syntax from DSL style to setters (eg.Hanami::Controller::Configuration.new { |c| c.default_request_format = :html }). (Luca Guidi in #281)Hanami::Controller::Configuration#initializereturns a frozen configuration instance. (Luca Guidi in #281)- Removed
Hanami::Controller::Configuration#prepare. (Luca Guidi in #281) - Removed
Hanami::Action.configuration. (Luca Guidi in #281) - Removed
Hanami::Action.configuration.handle_exceptions. (Luca Guidi in #281) - Removed
Hanami::Action.configuration.default_request_formatin favor of#default_request_format. (Luca Guidi in #281) - Removed
Hanami::Action.configuration.default_charsetin favor of#default_charset. (Luca Guidi in #281) - Removed
Hanami::Action.configuration.formatto register a MIME Type for a single action. Please use the configuration. (Luca Guidi in #281) - Removed
Hanami::Action.exposein favor ofHanami::Action::Response#[]=and#[]. (Luca Guidi in #281) - Removed
Hanami::Action#status=in favor ofHanami::Action::Response#status=. (Luca Guidi in #281) - Removed
Hanami::Action#body=in favor ofHanami::Action::Response#body=. (Luca Guidi in #281) - Removed
Hanami::Action#headersin favor ofHanami::Action::Response#headers. (Luca Guidi in #281) - Removed
Hanami::Action#accept?in favor ofHanami::Action::Request#accept?. (Luca Guidi in #281) - Removed
Hanami::Action#formatin favor ofHanami::Action::Response#format. (Luca Guidi in #281) - Introduced
Hanami::Action#formatas factory to assign response format:res.format = format(:json)orres.format = format("application/json"). (Luca Guidi in #281) - Removed
Hanami::Action#format=in favor ofHanami::Action::Response#format=. (Luca Guidi in #281) Hanami::Action.acceptnow looks at requestContent-Typeheader to accept/deny a request. (Gustavo Caso in #281)- Removed
Hanami::Action#request_idin favor ofHanami::Action::Request#id. (Luca Guidi in #281) - Removed
Hanami::Action#parsed_request_bodyin favor ofHanami::Action::Request#parsed_body. (Gustavo Caso in #281) - Removed
Hanami::Action#head?in favor ofHanami::Action::Request#head?. (Luca Guidi in #281) - Removed
Hanami::Action#statusin favor ofHanami::Action::Response#status=and#body=. (Luca Guidi in #281) - Removed
Hanami::Action#sessionin favor ofHanami::Action::Response#session. (Luca Guidi in #281) - Removed
Hanami::Action#cookiesin favor ofHanami::Action::Response#cookies. (Luca Guidi in #281) - Removed
Hanami::Action#flashin favor ofHanami::Action::Response#flash. (Luca Guidi in #281) - Removed
Hanami::Action#redirect_toin favor ofHanami::Action::Response#redirect_to. (Luca Guidi in #281) - Removed
Hanami::Action#cache_control,#expires, and#freshin favor ofHanami::Action::Response#cache_control,#expires, and#fresh, respectively. (Luca Guidi in #281) - Removed
Hanami::Action#send_fileand#unsafe_send_filein favor ofHanami::Action::Response#send_fileand#unsafe_send_file, respectively. (Luca Guidi in #281) - Removed
Hanami::Action#errors. (Luca Guidi in #281) - Removed body cleanup for
HEADrequests. (Gustavo Caso in #281) Hanami::Actioncallback hooks now acceptHanami::Action::RequestandHanami::Action::Responsearguments. (Luca Guidi in #281)- When an exception is raised, it won't be caught, unless it's handled. (Luca Guidi in #281)
Hanami::Actionexception handlers now acceptHanami::Action::Request,Hanami::Action::Response, and exception arguments. (Luca Guidi in #281)
1.3.3 - 2020-01-14
- Official support for Ruby: MRI 2.7. (Luca Guidi in #323)
- Support
rack2.1. (Luca Guidi in #323) - Support for both
hanami-validations1 and 2. (Luca Guidi in #323)
1.3.2 - 2019-06-28
- Ensure
Etagto work whenIf-Modified-Sinceis sent from browser and upstream proxy setsLast-Modifiedautomatically. (Ian Ker-Seymer in #321)
1.3.1 - 2019-01-18
- Official support for Ruby: MRI 2.6. (Luca Guidi in #317)
- Support
bundler2.0+. (Luca Guidi in #317)
1.3.0 - 2018-10-24
- Swappable JSON backed for
Hanami::Action::Flashbased onHanami::Utils::Json. (Gustavo Caso in #306)
1.3.0.beta1 - 2018-08-08
- Official support for JRuby 9.2.0.0. (Luca Guidi in #303)
- Deprecate
Hanami::Action#parsed_request_body. (Gustavo Caso in #302)
- Ensure that if
If-None-MatchorIf-Modified-Sinceresponse HTTP headers are missing,EtagorLast-Modifiedheaders will be in response HTTP headers. (Yuji Ueki in #299) - Don't show flash message for the request after a HTTP redirect. (Gustavo Caso in #301)
- Ensure
Hanami::Action::Flash#each,#map, and#empty?to not reference stale flash data. (Gustavo Caso in #301)
1.2.0 - 2018-04-11
1.2.0.rc2 - 2018-04-06
- Introduce
Hanami::Action::Flash#eachand#map. (Gustavo Caso in #294)
1.2.0.rc1 - 2018-03-30
1.2.0.beta2 - 2018-03-23
1.2.0.beta1 - 2018-02-28
- Official support for Ruby: MRI 2.5. (Luca Guidi in #290)
- Introduce
Hanami::Action.content_typeto accept/reject requests according to theirContent-Typeheader. (Sergey Fedorov in #207)
- Raise meaningful exception when trying to access
sessionorflashandHanami::Action::Sessionwasn't included. (wheresmyjetpack in #207)
1.1.1 - 2017-11-22
- Ensure
Hanami::Action#send_fileand#unsafe_send_fileto runafteraction callbacks. (Luca Guidi in #282) - Ensure Rack env to have the
REQUEST_METHODkey set toGETduring actions unit tests. (Luca Guidi in #282)
1.1.0 - 2017-10-25
- Introduce
Hanami::Action::CookieJar#eachto iterate through action'scookies. (Luca Guidi in #279)
1.1.0.rc1 - 2017-10-16
1.1.0.beta3 - 2017-10-04
1.1.0.beta2 - 2017-10-03
- Introduce
Hanami::Action::Params::Errors#addto add errors not generated by params validations. (Luca Guidi in #276)
1.1.0.beta1 - 2017-08-11
1.0.1 - 2017-07-10
- Ensure validation params to be symbolized in all the environments. (Marcello Rocha in #269)
- Fix regression (
1.0.0) about MIME type priority, during the evaluation of a weightedAcceptHTTP header. (Marcello Rocha in #269)
1.0.0 - 2017-04-06
1.0.0.rc1 - 2017-03-31
1.0.0.beta3 - 2017-03-17
Action#flashis now public API. (Luca Guidi in #262)
1.0.0.beta2 - 2017-03-02
- Add
Action#unsafe_send_fileto send files outside of the public directory of a project. (Marcello Rocha in #257)
- Ensure HTTP Cache to not crash when
HTTP_IF_MODIFIED_SINCEandHTTP_IF_NONE_MATCHhave blank values. (Anton Davydov in #253) - Keep flash values after a redirect. (Luca Guidi in #259)
- Ensure to return 404 when
Action#send_filecannot find a file with a globbed route. (Craig M. Wellington & Luca Guidi in #260) - Don't mutate Rack env when sending files. (Luca Guidi in #260)
1.0.0.beta1 - 2017-02-14
- Official support for Ruby: MRI 2.4. (Luca Guidi in #236)
- Make it work only with Rack 2.0. (Anton Davydov & Luca Guidi in #239)
- Avoid MIME type conflicts for
Action#formatdetection. (Marcello Rocha & Luca Guidi in #255) - Ensure
Flashto return only fresh data. (Matias H. Leidemer & Luca Guidi in #jardakotesovec) - Ensure
sessionkeys to be accessed as symbols in action unit tests. (Luca Guidi in #237)
0.8.1 - 2016-12-19
- Add
flashto the default exposures. (Luca Guidi in #233)
- Don't pollute Rack env's
rack.exceptionkey if an exception is handled. (Thorbjørn Hermansen in #234)
0.8.0 - 2016-11-15
- Allow
BaseParams#getto read (nested) arrays. (Marion Duprey in #227)
- Let
BaseParams#getto accept a list of keys (symbols) instead of string with dot notation (params.get(:customer, :address, :city)instead ofparams.get('customer.address.city')). (Luca Guidi in #229)
- Respect custom formats when referenced by HTTP
Accept. (Russell Cloak in #221) - Don't symbolize raw params. (Kyle Chong in #224)
0.7.1 - 2016-10-06
- Introduced
parsed_request_bodyfor action. (Kyle Chong in #155) - Introduced
Hanami::Action::BaseParams#each. (Luca Guidi in #176)
- Raise
Hanami::Controller::IllegalExposureErrorwhen try to expose reserved words:params, andflash. (akhramov & Luca Guidi in #195)
- Use default content type when
HTTP_ACCEPTis*/*. (Ayleen McCann in #211) - Don't stringify uploaded files. (Kyle Chong in #213)
- Don't stringify params values when not necessary. (Kyle Chong in #214)
0.7.0 - 2016-07-22
- Introduced
Hanami::Action::Params#error_messageswhich returns a flat collection of full error messages. (Luca Guidi in #165) - Nested params validation. (Steve Hodgkiss in #168)
- Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+. (Luca Guidi in #verbman)
- Param validations now require you to add
hanami-validationsinGemfile. (Luca Guidi in #verbman) - Removed "indifferent access" for params. Since now on, only symbols are allowed. (Luca Guidi in #verbman)
- Params are immutable. (Luca Guidi in #verbman)
- Params validations syntax has changed. (Luca Guidi in #verbman)
Hanami::Action::Params#errorsnow returns a Hash. Keys are symbols representing invalid params, while values are arrays of strings with a message of the failure. (Luca Guidi in #verbman)- Made
Hanami::Action::Session#errorspublic. (Vasilis Spilka in #171)
- Params are deeply symbolized. (Luca Guidi in #verbman)
- Send only changed cookies in HTTP response. (Artem Nistratov in #153)
0.6.1 - 2016-02-05
- Optimise memory usage by freezing MIME types constant. (Anatolii Didukh in #152)
0.6.0 - 2016-01-22
- Renamed the project. (Luca Guidi)
0.5.1 - 2016-01-19
- Ensure
rack.sessioncookie to not be sent twice when bothLotus::Action::CookiesandRack::Session::Cookieare used together. (Alfonso Uceda in #148)
0.5.0 - 2016-01-12
- Reference a raised exception in Rack env's
rack.exception. Compatibility with exception reporting SaaS. (Luca Guidi in #129)
- Removed
Lotus::Controller::Configuration#default_format. (Luca Guidi) - Made
Lotus::Action#sessiona public method for improved unit testing. (Cainã Costa in #135) - Introduced
Lotus::Controller::Errorand let all the framework exceptions to inherit from it. (Karim Tarek in #147)
- Ensure superclass exceptions to not shadow subclasses during exception handling (eg.
CustomErrorhandler will take precedence overStandardError). (Luca Guidi) - Ensure Rack environment to be always available for sessions unit tests. (Cainã Costa in #135)
0.4.6 - 2015-12-04
- Allow to force custom headers for responses that according to RFC shouldn't include them (eg 204). Override
#keep_response_header?(header)in action. (Luca Guidi in #124)
0.4.5 - 2015-09-30
- Added configuration entries:
#default_request_formatanddefault_response_format. (Theo Felippe in #122) - Error handling to take account of inherited exceptions. (Wellington Santos in #127)
- Deprecate
#default_formatin favor of:#default_request_format. (Theo Felippe in #122)
0.4.4 - 2015-06-23
- Security protection against Cross Site Request Forgery (CSRF). (Luca Guidi in #118)
- Ensure nested params to be correctly coerced to Hash. (Matthew Bellantoni in #107)
0.4.3 - 2015-05-22
- Introduced
Lotus::Action#send_file. (Alfonso Uceda Pompa in #105) - Set automatically
Expiresoption for cookies when it's missing butMax-Ageis present. Compatibility with old browsers. (Alfonso Uceda Pompa in #102)
0.4.2 - 2015-05-15
- Ensure
Lotus::Action::Params#to_hto return::Hashat the top level. (Luca Guidi in #101)
0.4.1 - 2015-05-15
- Prevent
Content-TypeandContent-Lenghtto be sent when status code requires no body (eg.204). This is for compatibility withRack::Lint, not with RFC 2016. (Alfonso Uceda Pompa in #99) - Ensure
Lotus::Action::Params#to_hto return::Hash. (Luca Guidi in #96)
- Ensure proper automatic
Content-Typeworking well with Internet Explorer. (Luca Guidi in #94) - Ensure
Lotus::Action#redirect_toto return::Stringfor Rack servers compatibility. (Luca Guidi in #95)
0.4.0 - 2015-03-23
Action.usenow accepts a block. (Erol Fornoles in #70)- Introduced
Lotus::Controller::Configuration#cookiesas default cookie options. (Alfonso Uceda Pompa in #77) - Introduced
Lotus::Controller::Configuration#default_headersas default HTTP headers to return in all the responses. (Alfonso Uceda Pompa in #82) - Introduced
Lotus::Action::Params#getas a safe API to access nested params. (Luca Guidi in #89)
redirect_tonow is a flow control method: it terminates the execution of an action, including the callbacks. (Alfonso Uceda Pompa in #73)
0.3.2 - 2015-01-30
- Callbacks: introduced
append_before(alias ofbefore),append_after(alias ofafter),prepend_beforeandprepend_after. (Alfonso Uceda Pompa in #65) - Introduced
Lotus::Action::Params#rawwhich returns unfiltered data as it comes from an HTTP request. (Alfonso Uceda Pompa in #69) Lotus::Action::Rack.usenow fully supports Rack middleware, by mounting an internalRack::Builderinstance. (Alfonso Uceda Pompa in #66)- Introduced
Lotus::Action::Throwable#haltnow accepts an optional message. If missing it falls back to the corresponding HTTP status message. (Simone Carletti in #67) - Nested params validation. (Steve Hodgkiss in #50)
- Ensure HEAD requests will return empty body. (Luca Guidi in #57)
- Ensure HTTP status codes with empty body won't send body and non-entity headers. (Stefano Verna in #18)
- Only dump exceptions in
rack.errorsif handling is turned off, or the raised exception is not managed. (Luca Guidi in #58) - Ensure params will return coerced values. (Luca Guidi in #58)
0.3.1 - 2015-01-08
- Introduced
Action#requestwhich returns an instance aRack::Requestcompliant object:Lotus::Action::Request. (Lasse Skindstad Ebert in #48)
- Ensure params to return coerced values. (Steve Hodgkiss in #54)
0.3.0 - 2014-12-23
- Introduced
Action#request_idas unique identifier for an incoming HTTP request. (Luca Guidi) - Introduced
Lotus::Controller.load!as loading framework entry point. (Luca Guidi) - Allow to define a default charset (
default_charsetconfiguration). (Kir Shatrov in #45) - Automatic content type with charset (eg
Content-Type: text/html; charset=utf-8). (Kir Shatrov in #45) - Allow to specify custom exception handlers: procs or methods (
exception_handlerconfiguration). (Michał Krzyżanowski in #44) - Introduced HTTP caching (
Cache-Control,Last-Modified, ETAG, Conditional GET, expires). (Karl Freeman & Lucas Souza in #43) - Introduced
Action::Params#to_hand#to_hash. (Satoshi Amemiya in #42) - Added
#paramsand#errorsas default exposures. (Luca Guidi) - Introduced complete params validations. (Luca Guidi)
- Allow to whitelist params. (Luca Guidi & Matthew Bellantoni in #38)
- Allow to define custom classes for params via
Action.params. (Luca Guidi & Matthew Bellantoni in #38) - Introduced
Action#formatas query method to introspect the requested mime type. (Krzysztof Zalewski in #37) - Official support for Ruby 2.2. (Luca Guidi)
- Renamed
Configuration#modulesto#prepare. (Trung Lê in #41) - Update HTTP status codes to IETF RFC 7231. (Luca Guidi)
- When
Lotus::Controlleris included, don't inject code. (Luca Guidi) - Removed
Controller.actionas a DSL to define actions. (Luca Guidi) - Removed
Action#content_typein favor of#format=which accepts a symbol (eg.:json). (Krzysztof Zalewski in #37) - Reduce method visibility where possible (Ruby
privateandprotected). (Fuad Saud in #17)
- Don't let exposures definition to override existing methods. (Luca Guidi in #40)
0.2.0 - 2014-06-23
- Introduced
Controller.configureandController.duplicate. (Luca Guidi) - Introduced
Action.use, that let to use a Rack middleware as a before callback. (Luca Guidi) - Allow to define a default mime type when the request is
Accept: */*(default_formatconfiguration). (Luca Guidi) - Allow to register custom mime types and associate them to a symbol (
formatconfiguration). (Luca Guidi) - Introduced
Configuration#handle_exceptionsto associate exceptions to HTTP statuses. (Luca Guidi) - Allow developers to toggle exception handling (
handle_exceptionsconfiguration). (Damir Zekic in #23) - Introduced
Controller::Configuration. (Luca Guidi) - Official support for Ruby 2.1. (Luca Guidi)
Lotus::Action::Paramsdoesn't inherit fromLotus::Utils::Hashanymore. (Luca Guidi)Lotus::Action::CookieJardoesn't inherit fromLotus::Utils::Hashanymore. (Luca Guidi)- Make HTTP status messages compliant with IANA and Rack. (Luca Guidi)
- Moved
#throwoverride logic into#halt, which keeps the same semantic. (Damir Zekic in #28)
- Reference exception in
rack.errors. (Krzysztof Zalewski in #26)
0.1.0 - 2014-02-23
- Introduced
Action.acceptto whitelist accepted mime types. (Luca Guidi) - Introduced
Action#accept?as a query method for the current request. (Luca Guidi) - Allow to whitelist handled exceptions and associate them to an HTTP status. (Luca Guidi)
- Automatic
Content-Type. (Luca Guidi) - Use
throwas a control flow which understands HTTP status. (Luca Guidi) - Introduced opt-in support for HTTP/Rack cookies. (Luca Guidi)
- Introduced opt-in support for HTTP/Rack sessions. (Luca Guidi)
- Introduced HTTP redirect API. (Luca Guidi)
- Introduced callbacks for actions: before and after. (Luca Guidi)
- Introduced exceptions handling with HTTP statuses. (Luca Guidi)
- Introduced exposures. (Luca Guidi)
- Introduced basic actions compatible with Rack. (Luca Guidi)
- Official support for Ruby 2.0. (Luca Guidi)