2015-04-14 19:12:24 +00:00
|
|
|
class ApiSignupHintsController < ApiController
|
|
|
|
|
|
2016-04-06 02:23:15 +00:00
|
|
|
before_filter :api_anonymous_user, except: [:create_redirect]
|
|
|
|
|
before_filter :api_signed_in_user, only: [:create_redirect]
|
2015-04-14 19:12:24 +00:00
|
|
|
|
|
|
|
|
respond_to :json
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
@signup_hint = SignupHint.find(params[:id])
|
|
|
|
|
respond_with_model(@signup_hint)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
|
@signup_hint = SignupHint.refresh_by_anoymous_user(anonymous_user, params)
|
|
|
|
|
|
|
|
|
|
respond_with_model(@signup_hint, new: true, location: lambda { return api_signup_hint_detail_url(@signup_hint.id) })
|
|
|
|
|
end
|
2016-04-06 02:23:15 +00:00
|
|
|
|
|
|
|
|
def create_redirect
|
|
|
|
|
@signup_hint = SignupHint.create_redirect(current_user, params)
|
|
|
|
|
|
|
|
|
|
respond_with_model(@signup_hint, new: true, location: lambda { return api_signup_hint_detail_url(@signup_hint.id) })
|
|
|
|
|
end
|
2015-04-14 19:12:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|