title: more logical outlook of produce this
body: <p>hi im just wondering if there is a more simpler/logical way of achieving the below</p>
  
  <pre><code>def index
    @date = params[:month] ? Date.parse(params[:month]) : Date.today
    @schedule = Schedule.new
    @players = User.where(:team_id =&gt; current_user[:team_id]).all
  
    if current_user.admin?
      @schedules = Schedule.all
    elsif current_user.manager?
      @schedules = Schedule.find_all_by_team_id(current_user[:team_id])
    if @schedules.count &lt; 1
      redirect_to(root_path, :status =&gt; 301, :alert =&gt; "This team has no upcoming events&lt;br/&gt; You should add your next event, and TeamMNGT will take care of everything else!".html_safe)
      return
    end
    elsif current_user.team_id?
      @schedules = Schedule.find_all_by_team_id(current_user[:team_id])
    elsif @schedules.count &lt; 1 and current_user.team_id?
      redirect_to(root_path, :status =&gt; 301, :alert =&gt; "You don't have any upcoming events.&lt;br/&gt; Your team manager has not added any upcoming events for #{@team.name}".html_safe)
    return
    else
      redirect_to root_path, :status =&gt; 301, :alert =&gt; "Please contact your club administrator to be assigned to a team."
    return
    end
    respond_to do |format|
      format.html # index.html.erb
      format.json { render :json =&gt; @schedules }
    end
  </code></pre>
  
  <p>end</p>