I get a bool value as a parameter and assign it to a variable
@package = params[:package]
Now, I have a method which should return a string based on the value of package. The method looks like this:
def get_description(package)
if package == 1
"foo"
elsif package == 2
"bar"
end
end
In another method, I try to get the @description by:
@description = get_description(@package)
The problem is, the string is not displayed. The @description variable stays empty. Maybe I’m too stupid to see the bug?
If you want you can use your code changing the value of package to integer:
Or using a case statement: