Giter Site home page Giter Site logo

Errors on redirect about controller HOT 5 CLOSED

hanami avatar hanami commented on May 17, 2024
Errors on redirect

from controller.

Comments (5)

jodosha avatar jodosha commented on May 17, 2024

Hello @mvader Thanks for opening this ticket. Are you using this framework alone, or with lotusrb?

from controller.

erizocosmico avatar erizocosmico commented on May 17, 2024

I'm using it with lotusrb.
On Apr 7, 2015 11:08 AM, Luca Guidi [email protected] wrote:Hello @mvader Thanks for opening this ticket. Are you using this framework alone, or with lotusrb?

β€”Reply to this email directly or view it on GitHub.

from controller.

jodosha avatar jodosha commented on May 17, 2024

@mvader Which kind of error do you get? Is this related to hanami/hanami#196 ? Can you please post the stack trace here? Thank you.

from controller.

erizocosmico avatar erizocosmico commented on May 17, 2024

I don't get any error. It just doesn't work as expected. I've been able to reproduce even with the fix you mentioned in #196.

Just setup an application with cookies and the session like that:

cookies true
sessions :cookie, secret: ENV['WEB_SESSIONS_SECRET']

Once you've submitted a form with errors, on every other request the retrieved errors via the errors method are the same, no matter what the input parameters were.

As I said, two cookies are set, maybe that's the problem. I implemented the sessions and cookies myself using Rack::Session and it worked. With Rack::Session only one cookie was set.

New action:

module Web::Controllers::Foo
  class New
    include Web::Action

    def call(params)
      puts errors.inspect?
    end
  end
end

Create action:

module Web::Controllers::Foo
  class Create
    include Web::Action

    params do
      param :title, presence: true, size: 3..255
    end

    def call(params)
      if !params.valid?
          # foo
      else
         # foo
      end
    end
  end
end

from controller.

jodosha avatar jodosha commented on May 17, 2024

Closing because I think it was fixed by #100

from controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.