Skip to content

Instantly share code, notes, and snippets.

@daiksy
Last active December 16, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daiksy/5363696 to your computer and use it in GitHub Desktop.
Save daiksy/5363696 to your computer and use it in GitHub Desktop.
質問にお答えする

step1

パラメータを受け取るコントローラを作る

object Application extends Controller {
  def parameterExample(parameter: String) = Action  {
    Ok(views.html.index(parameter))
  }
}

step2

conf/routesでURLとControllerをひもづける

GET     /example/execute     controllers.Application.parameterExample(parameter: String)

step3

実行してURLを叩く

http://localhost:9000/example/execute?parameter=hoge

以上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment