Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ashrlh/master #22

Open
wants to merge 51 commits into
base: ashrlh/master
Choose a base branch
from

Conversation

annaleeherrera
Copy link

FarMarRails

annaleeherrera and others added 30 commits November 18, 2015 10:41
end

def mkt_home
@market = Market.find(params[:id])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we're setting the @market variable in this same way in a few different methods, I think we could DRY this out a bit by moving that line into a before_action, like so:

class MarketsController < ApplicationController
  before_action :find_market, only: [:mkt_home, :show, :edit, :update]

  # all of your existing methods...

private

  def find_market
    @market = Market.find(params[:id])
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants