You can use `:method => :post` with `link_to` if Rails supports it.

The concern is that this is a side-effecting behavior. Consider what
happens if the link somehow gets picked up by Google: Suddenly a bot is
claiming prizes in a loop :-)

Even more simply though, weirdness happens with back buttons and things.
It's always a good idea to avoid using GET for this kind of stuff.


On Tue, Nov 19, 2013 at 8:17 PM, cpirich <notifications@github.com> wrote:

> In config/routes.rb:
>
> > @@ -31,6 +30,9 @@
> >
> >    get '/k8intro/:chapter', to: 'script_levels#show', script_id: Script::TWENTY_HOUR_ID, as: 'k8intro_chapter', format: false
> >
> > +  resources :prize_providers
> > +  get '/prize_providers/:id/claim_prize', to: 'prize_providers#claim_prize', as: 'prize_provider_claim_prize'
>
> this one I went back and forth on. decided on GET because it is much
> easier to use in the UX with parameters and link_to instead of creating
> forms with hidden parameters. But I get the idea and started with it as a
> POST until it became inconvenient.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/code-dot-org/dashboard/pull/160/files#r7779915>
> .
>