Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなテンプレートがある場合:
<div class="lift:ThisIsMySnippet?option1=a_value;option2=another_value"> <div class="morestuff"> {embed} </div> </div>
そして、次のようなスニペット:
class ThisIsMySnippet { // I want option1's value! }
これらの値を取得するにはどうすればよいですか?
S次のように、オブジェクトを介してスニペットのパラメーター値を取得できると思います。
S
val x = S.attr("option1")
この場合、xは になるBox[String]ので、安全な方法で値を取得したい場合は、次のようにすることができます。
x
Box[String]
val x = S.attr("option1") openOr "defaultValue"
routes.rb ファイルに次のコードがあります。
resources :users do member do get :following,:followers end collection do put :activate_email end end