ユーザーがログインしているときに、div ボタンの色を変更する必要があります。
ユーザーがログインしたら、img の「今すぐ再生」ボタンのように、「ダウンロード ボタン」が赤色で表示されるようにします。
これは今のコードです:
#play_buttons
#instant_play.play_button
%p
= "#{t :"asiaplus.download_client"}"
.button
= "#{t :"asianplus.download_now"}"
#play_now.play_button
%p
%span.highlight
= "#{t :"asiaplus.web_based"}"
= "#{t :"asiaplus.live_dealer"}"
%a{:href => "#{live_casino_ho_lobby_asia_path(:tab => current_tab, :locale => current_locale)}", :class => "button", :title => "#{t :'asiaplus.play_now'}", :id => "ho_roulette"}
= "#{t :"asiaplus.play_now"}"
.button
左側の「今すぐダウンロード」ボタンのクラスで:id => "ho_roulette"
、右側の「今すぐプレイ」ボタンのスタイルを指定します。
これは、ユーザーがログインしているときに [今すぐ再生] ボタンのような [今すぐダウンロード] ボタン スタイルを実現するための私のソリューションです。
#play_buttons
- if logged_in
#instant_play.play_button
%p
= "#{t :"asiaplus.download_client"}"
.button
= "#{t :"asianplus.download_now" :id => "ho_roulette"}"
#play_now.play_button
%p
%span.highlight
= "#{t :"asiaplus.web_based"}"
= "#{t :"asiaplus.live_dealer"}"
%a{:href => "#{live_casino_ho_lobby_asia_path(:tab => current_tab, :locale => current_locale)}", :class => "button", :title => "#{t :'asiaplus.play_now'}", :id => "ho_roulette"}
= "#{t :"asiaplus.play_now"}"
- else
#instant_play.play_button
%p
= "#{t :"asiaplus.download_client"}"
.button
= "#{t :"asianplus.download_now"}"
#play_now.play_button
%p
%span.highlight
= "#{t :"asiaplus.web_based"}"
= "#{t :"asiaplus.live_dealer"}"
%a{:href => "#{live_casino_ho_lobby_asia_path(:tab => current_tab, :locale => current_locale)}", :class => "button", :title => "#{t :'asiaplus.play_now'}", :id => "ho_roulette"}
= "#{t :"asiaplus.play_now"}"
:id => "ho_roulette"
基本的に、ユーザーがログインしているときに div ボタンに追加する条件ステートメントを使用しました。
この解決策は正しいですか?ステータス クラス アクティブを他のソリューションとして使用することもできると思いましたが、SASS ファイルには触れたくありませんでした。