flame flash
1.0.0
炎のためのフラッシュ。
# 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
%> 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
enderrorwarningnoticeリポジトリをチェックした後、 bundle installを実行して依存関係をインストールします。
次に、 toys rspecを実行してテストを実行します。
この宝石をローカルマシンに取り付けるには、 toys gem installを実行します。
新しいバージョンをリリースするには、 toys gem release %version%を実行します。ここでどのように機能するかをご覧ください。
GitHubでバグレポートとプルリクエストを歓迎します。
宝石は、MITライセンスの条件の下でオープンソースとして利用できます。