Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionController::InvalidAuthenticityToken when using hooks #551

Open
stefatkins opened this issue Mar 29, 2022 · 0 comments
Open

ActionController::InvalidAuthenticityToken when using hooks #551

stefatkins opened this issue Mar 29, 2022 · 0 comments

Comments

@stefatkins
Copy link

Expected behavior

When I use smart action hook (load). I would like to execute the code that is written.

Actual behavior

When I click on my smart action a POST to /forest/actions/deny-document/hooks/loadis sent but I get an ActionController::InvalidAuthenticityToken error. This does work on a local environnent.

Failure Logs

Capture d’écran 2022-03-29 à 18 24 57

Code

class Forest::Document
  include ForestLiana::Collection
  collection :Document

  action 'Deny Document', type: 'single',
                          fields: [
                            {
                              field: 'denial_reason',
                              type: 'Enum',
                              description: 'Please select the reason of the denial',
                              enums: ["reason1", "reason2"],
                              is_required: true,
                              hook: 'on_denial_reason_changed'
                            }
                          ],
                          hooks: {
                            load: lambda { |context|
                              puts "hello"
                            },
                            change: {
                              'on_denial_reason_changed' => lambda { |context|
                                puts "changed"
                              }
                            }
                          }
end

Context

  • Package Version: 7.4.1
  • Rails Version: 6.1.4.7
  • Database Dialect: Postgres
  • Database Version: 14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant