hello for my app I need to save a record that the user type, for example if an user type in:
<p><%= f.label :fruit %><br />
<%= f.file_field :fruit%></p>
"apple"
in the show page I need that record appears like
"bag of "+ :fuit
, but I don’t want to save “bag of”, how can I put that text when the user is in the show page??
I have read something about the filters but I don’t understand so much I’m pretty new in rails
if you need more info (like code) just tell me, thanks
EDIT
for now in my model I have this
before_save: add_bag
def add_bag
self.fruit = ("bag of" + self.fruit)
end
but that save all this “bag of apple”
I recommend you do something like this (assuming your model is Foo)
Is this what you want?