Params question

I'm a little embarrassed to ask this but I have a url that is like:

foo/bar/5?start=45

and in foo_controller I'm trying to access it like so:

def bar     @start_time = get_start_time(params) end

def get_start_time(params)     if params['start'].to_s != nil       return '?start='+params['start'].to_s     end   end

I'm coming from PHP/.NET so RESTfulness is a little difficult for me to wrap my head around. Maybe I'm googling on the wrong terms but I haven't had any luck yet...Any advice would be very appreciated.

I'm not sure what exactly your trying to do with the get_start_time method when it looks like you just want:

@start_time = params[:start]

Here is a good REST pdf. http://www.rubyinside.com/restful-rails-development-pdf-released-392.html

Hi thanks for the respone. I just need to have @start_time = "? start="+params[:start] only if params[:start] isn't empty, i.e. if the url isn't

foo/bar/5?start=45

but is

foo/bar/5

That works perfectly, thank you so much. I'm curious how ruby, like, well anything else I work with, doesn't require a return statement:

  def get_start_time(params)     if params['start']       return "?start=#{params['start']}"     end   end

The value returned by a Ruby method is the value of the last
expression evaluated.

Read: http://www.rubycentral.com/book/intro.html

Best, Thomas