Last active
August 29, 2015 13:59
-
-
Save jodosha/10451435 to your computer and use it in GitHub Desktop.
Use sessions in Lotus::Action. In response of https://gist.github.com/sidonath/10450111
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lotus/controller' | |
module Blog | |
module Action | |
def self.included(base) | |
base.class_eval do | |
include Lotus::Action | |
include Lotus::Action::Session | |
end | |
end | |
end | |
end | |
class Show | |
include Blog::Action | |
def call(params) | |
# ... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Rack::Session::Cookie, secret: SecureRandom.hex(64) | |
run Show.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment