singapore web design services,graphic designer in singapore,android developer singapore,ios developer singapore,mobile game developer singapore,web designer singapore,singapore mobile application developer,website development singapore,web design services singapore,singapore web development,ios app development singapore,design firms in singapore,web application singapore,developer in singapore,mobile application development singapore,singapore web design,mobile developer singapore,ruby on rails developer singapore,app developer singapore,web development singapore,web design company singapore,singapore mobile app developer,developers in singapore,app development singapore,singapore website design,website developer singapore,web design singapore,design agency singapore,website designer singapore,mobile apps singapore,website design singapore,mobile application developer singapore,singapore app developer,mobile app developer singapore,mobile apps development singapore,web development company singapore,mobile app development singapore

Ruby on Rails – Anatomy of a Request object

Display current url without base url

<%= request.request_uri %> / <%= request.path%>
eg: /vinova/development/web_and_iphone_apps

Display previous url with base url

<%= request.referer %>

Display base url

<%= request.env[‘HTTP_HOST’]%>

Display protocol

<%= request.env[‘SERVER_PROTOCOL’]%>
eg: HTTP/1.1

Full url

<%= request.url%>

Display how many parameters found in current url

<%= request.query_parameters.size %>

url eg:
answer: 2 => (2 parameters)

Display controller name from current url

<%= request.path_parameters[‘controller’] %>
eg: contents

Display action name from current url

<%= request.path_parameters[‘action’] %>
eg: login

Everything inside a request

<%= request.inspect%>

Malcare WordPress Security