singapore mobile application developer,web development company singapore,app development singapore,design agency singapore,developer in singapore,app developer singapore,website design singapore,design firms in singapore,singapore web design services,mobile apps singapore,ruby on rails developer singapore,ios app development singapore,web designer singapore,mobile developer singapore,android developer singapore,singapore website design,singapore web development,graphic designer in singapore,developers in singapore,website development singapore,mobile app developer singapore,website designer singapore,web development singapore,singapore mobile app developer,web design singapore,web design services singapore,ios developer singapore,website developer singapore,web application singapore,web design company singapore,singapore app developer,mobile apps development singapore,singapore web design,mobile game developer singapore,mobile application development singapore,mobile app development singapore,mobile application developer 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%>

%d bloggers like this:
WordPress Security