Skip to content

Instantly share code, notes, and snippets.

View abloom's full-sized avatar

Andrew Bloom abloom

  • Turquoise Health
  • Chicago Il
View GitHub Profile
class LinkBar
def initialize
@bars = Hash.new
end
def register(linkbar_name, links)
@bars[linkbar_name] ||= []
@bars[linkbar_name].concat links
end
#This is the form tag I normally have to do
<% #form_for game_player,:url => game_player_path(params[:slug], game_player) do |f| %>
#This is what I was trying
# This form submits to http://localhost:3000/game_players/update_all, I need the team slug in front
<% form_tag (:controller => "game_players", :action => "update_all") do %>
<% for game_player in @game_players %>
<% fields_for "game_player_#{game_player.id}" do |f| %>
<%= f.error_messages %>
ActionController::Routing::Routes.draw do |map|
map.resources :fans
map.resources :league_players
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.check '/check', :controller => 'sessions', :action => 'create'