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

flame-flash

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flame-flash

  • 3.0.1.rc2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Flame Flash

Cirrus CI - Base Branch Build Status Codecov branch Code Climate Depfu Inline docs Gem License

Flashes for Flame.

Usage

# Gemfile
gem 'flame-flash'

# config.ru
require 'flame-flash' # or `Bundler.require`

# _controller.rb
include Flame::Flash
<!-- layout.html.erb -->

<%
  %i[error warning notice].each do |type|
    flash[type].each do |text|
%>
      <p class="flash <%= type %>">
        <%= text %>
      </p>
<%
    end
  end
%>

Examples

class PostsController < Flame::Controller
  def update
    flash[:error] = "You don't have permissions"
    redirect :show
  end

  def delete
    redirect :show, notice: 'Deleted'
  end

  def move
    redirect :index, flash: { success: 'Moved' }
  end

  def create
    flash.now[:error] = 'Not enought permissions'
    view :new
  end
end

Reserved keys

  • error
  • warning
  • notice

Development

After checking out the repo, run bundle install to install dependencies.

Then, run toys rspec to run the tests.

To install this gem onto your local machine, run toys gem install.

To release a new version, run toys gem release %version%. See how it works here.

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 24 Sep 2022

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