Skip to content

Instantly share code, notes, and snippets.

@tubbo tubbo/model.rb forked from wolfravenous/model.rb
Last active Oct 5, 2016

Embed
What would you like to do?
Need to move Logic From the View into The Model, Rails v. 4.2, The current entry in the model for setting the gender in comments, works correctly because comment is an attribute of report. Would like to move the logic currently in the view to the model, however I am unsure of how to because content is an attribute of intro, which is a nested res…
def genderized_comment
comment.gsub(/HESHE/, gender_pronoun.capitalize)
end
def gender_pronoun
gender == 'female' ? 'she' : 'he'
end
<p><%= @report.genderized_comment %></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.