Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

action-segue

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

action-segue

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

ActionSegue

Allows you to create simple flows between controllers and actions which you can then complete or resume.

To begin with, you can register the beginning of a segue in a controller:

class MyController < ApplicationController
  register_segue action: :index, as: :looking_at_index

  def index
    ...
  end
end

Then, at any point in the future, you can return to this segue start point. You must also pass in a fallback location which is used in the event no segue with the id is in progress.

redirect_to complete_segue_url(:looking_at_index, fallback: dashboard_path)

If you just want to clear a segue to remove it from the stack, you can use clear_segue:

clear_segue :looking_at_index

If you don't know (or care) what current segue is in progress (useful in situations where many actions could lead away from their flow, and you just want to return to the original flow), you can just complete the current segue. This also requires a fallback location in case there is no current segue in progress.

redirect_to complete_current_segue_url(fallback: dashboard_path)

TODO

  • Make it possible to use something other than the session to store segue info

FAQs

Package last updated on 08 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc