Im trying to pass a parameter (a file path : eg. user/lauren/tools/
) from a view in RAILS to another different controller using RUBY. I want to use the file path (as a string) to be matched with a regular expression. To do that, right now Im using the params [:parameter]
method as follows in the controller action where Im setting the variable instance:
@variable = /^.+\/[^\/]+$/.match(params[:name]).to_s ---where :name is the parameter passed from view
Right now, I dont get any output when I try to display that in the corresponding view of that controller....im guessing its the params [:name]
method I need to replace or modify?
Id really appreciate views on this...thanks!