<% url = @bucket.new_record? ? team_path(current_user.team) : team_bucket_path(current_user.team, @bucket) %>

<%= form_for @bucket, :url => url do |f| %>
  <% if @bucket.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@bucket.errors.count, "error") %> prohibited this bucket from being saved:</h2>

      <ul>
      <% @bucket.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br>
    <%= f.text_field :name %>
  </div>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

<% url = @bucket.new_record? ? team_buckets_path(current_user.team) : team_bucket_path(current_user.team, @bucket) %>

<%= form_for @bucket, :url => url do |f| %>
  <% if @bucket.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@bucket.errors.count, "error") %> prohibited this bucket from being saved:</h2>

      <ul>
      <% @bucket.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br>
    <%= f.text_field :name %>
  </div>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Fix bucket new form path
Fix bucket new form path
