Moncho Chavez
Moncho Chavez

Reputation: 694

Rails condition based on URL

Hi im working on a Rails app, i didnt write the whole app, there is a part where i need to Echo a meesage if the user is Elite.. i know that in the URL i have the info

sign_up?locale=en&t=elite

Is there any chance i can use that in view to do something like you would do a GET condition pn PHP?

i mean if (t=elite) {echo this} else {}

Hope anyone can give me an easy solution for this, that not requiere wirte a hole method just for echoing 1 little message just for that kind of users.

thanks, also just as note im a noob on rails, but im doing just HTML/CSS integration

Upvotes: 1

Views: 218

Answers (1)

Ross Allen
Ross Allen

Reputation: 44880

Query parameters are available in the params Hash on each request:

<% if "elite" == params[:t] %>Check it out<% end %>

Upvotes: 3

Related Questions