2
module SessionsHelper 
def store_location 
  session[:path] = request.path if request.get?
end

This returns '/friends' or '/users' or '/new' etc. I want to remove the '/' from the beginning of it.

I then tried to add into module SessionsHelper the following method:

def removal() 
  self[1..self.length]
end

and changed the store_location method to:

session[:path] = request.path.removal() if request.get?

but I am getting the following error:

NoMethodError (undefined method `removal()' for "/friends":String):

So then after searching it looks I need to do something with class String but I am uncertain how to set this up properly.

Timmy Von Heiss
  • 2,160
  • 17
  • 39

0 Answers0