current_user.feed item = feed.items.find(params[:id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end end MEMBER Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end end MEMBER Tuesday, July 3, 12
= current_user.feed item = feed.items.find(params[:id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end def remove_refeed end end Tuesday, July 3, 12
= current_user.feed item = feed.items.find(params[:id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end def remove_refeed end end Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:item_id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end def destroy end end ARGH? Tuesday, July 3, 12
= current_user.feed item = feed.items.find(params[:item_id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end def destroy end end Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:item_id]) attrs = item.attributes.merge(refed_item: item) feed.items.create(attrs) redirect_to(feed) end def destroy end end ARGH? Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:item_id]) refeed = Refeed.new(feed, item) refeed.create redirect_to(feed) end def destroy end end MEH! Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:item_id]) refeed = Refeed.new(feed, item) refeed.create redirect_to(feed) end def destroy end end MEH! Tuesday, July 3, 12
include ActiveModel::Translation end end attr_reader :attributes, :errors def initialize(attributes = {}) @attributes = attributes @errors = ActiveModel::Errors.new(self) end end app/Mixins Tuesday, July 3, 12
def to_partial_path; ”" end def valid? errors.empty? end def persisted?; false end def read_attribute_for_validation(key) @attributes[key] end end app/Mixins Tuesday, July 3, 12
save feed = attributes[:feed] item = feed.items.find(attributes[:item_id]) atrs = item.attributes.merge(refed_item: item) feed.items.create(atrs) end end app/models Tuesday, July 3, 12
def save feed = attributes[:feed] item = feed.items.find(attributes[:item_id]) atrs = item.attributes.merge(refed_item: item) feed.items.create(atrs) end end Tuesday, July 3, 12
current_user.feed item = feed.items.find(params[:item_id]) refeed = Refeed.new(feed, item) refeed.create redirect_to(feed) end def destroy end end Meh! Tuesday, July 3, 12
current_user.feed item = feed.find(params[:item_id]) refeed = Refeed.new(feed: feed, item: item) if refeed.save redirect_to refeed_path(refeed) end end def destroy end end Okay! Tuesday, July 3, 12