ruby on rails - delete last value of a splitted string -
I want to look at a hash but the last value should be:
parameter controller Send to Method log < / Strong> The issue is that the #Eech value (["a@a.fr", "Lol@lol.fr"]) which is not in the hash I will do this: P therefore: You just need to:
{"User" => {"Email" = & gt; "A@a.fr, lol@lol.fr"}
def set_users @users = params [ : User] [: email] logger.debug "# {@ users.split (", "}". Each {| e | insert E}} "end
a@a.fr Eligible @ Lol.fr ["a@a.fr", "lol@lol.fr"]
@ users.split (", ") [0 ..- 2] Meaning, take everything but ultimate.
logger.debug @ users.split (",") [0 ..- 2] .join (',') < / Pre>
logger.debug @users
Comments
Post a Comment