I am trying to gather information from a database and then pass that information on to my view via flash. Unfortunately the information is formatting in an ActiveRecord::Relation and not in any format that I can read.
Controller Query
@message = Message.where(:all).limit(4).order(id: :desc).only(:order,:where)
flash[:response] = @message
redirect_to (:back)
If I do something like
@message = Message.where(:all).limit(4).order(id: :desc).only(:order,:where)
flash[:response] = @message.first.mess
redirect_to (:back)
To try and get the first returned value in the mess column, I get an undefined method error. I have been trying to find a tutorial that tells me how to take information once my query has been run but I have not had much luck with Rail's tutorials as of late. I appreciate any help that you guys can give. After I do this I am going to try to format the 4 different results on the view side.