Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:52:08+00:00 2026-06-02T14:52:08+00:00

I am trying to use formtastic to make a form where I can enter

  • 0

I am trying to use formtastic to make a form where I can enter an :opposition choose a :venue and a :team and then be presented with a list of players that I am able to check off to select them for the

I have got the form set up so it renders correctly however when submitted it does not save any information and just reloads the page.

My code is at my github here: https://github.com/jpknegtel/st_francis

models

This concerns the following models:

player

 has_many :player_fixtures
 has_many :fixtures, :through => :player_fixtures

fixtures

 has_many :player_fixtures
 has_many :players, :through => :player_fixtures

PlayerFixture

belongs_to :player
belongs_to :fixture

controller

def create
@fixture = Fixture.new(params[:fixture])
if @fixture.save
  flash[:notice] = "Fixture Created"
  redirect_to(:action =>'list')
else
  flash.now[:error] = "Could not save fixture. Please re-enter information"
  render('new')
end
end

def new
 @fixture = Fixture.new
end

form

<%= semantic_form_for :fixture do |f| %>
 <%= f.inputs do %>
  <%= f.input :opposition  %>
  <%= f.input :team, :as => :select, :collection => Team.all %>
  <%= f.input :venue, :as => :check_boxes, :collection => Hash[Venue.all.map{|b| [b.name, b.id]}]%>
  <%= f.input :players, :as => :check_boxes, :collection => Hash[Player.all.map{|b| [b.full_name, b.id]}], :required => true  %>
<% end %>
<%= f.actions do %>
 <%=  f.action :submit, :as => :button %>
 <%=  f.action :cancel, :as => :link %>
<% end %>
<% end %>

So when the form is submitted now nothing is passed. When looking at the web brick server nothing gets submitted but the page just gets reloaded.

It is possible to insert the records using rails console.

EDIT: I can now see this when submitted.

Started POST "/fixtures/new" for 127.0.0.1 at 2012-04-23 15:00:21 +0100
Processing by FixturesController#new as HTML
Parameters: {"utf8"=>"✓",     "authenticity_token"=>"Hx4TChWiUdhpZbAfgWUYMWBKao86pZh0tGzwVKy+P80=", "fixture"=> {"opposition"=>"Mid sussex", "team"=>"1", "venue"=>["", "1"], "players"=>["", "1", "3"]}, "button"=>""}
Team Load (1.0ms)  SELECT `teams`.* FROM `teams` 
Venue Load (1.0ms)  SELECT `venues`.* FROM `venues` 
Player Load (1.0ms)  SELECT `players`.* FROM `players` 
Rendered fixtures/new.html.erb within layouts/application (173.0ms)
Completed 200 OK in 200ms (Views: 163.0ms | ActiveRecord: 36.0ms)
[2012-04-23 15:00:21] WARN  Could not determine content-length of response body. Set     content-length of the response or set Response#chunked = true
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:52:21+00:00Added an answer on June 2, 2026 at 2:52 pm

    My guess is massassignment. You need to allow rails to update some attributes via massassignment.

    Add this line to your fixtures model:

    attr_accessible :players_attributes, :opposition, :team_id, :venue_id, :date
    

    This allows rails to set these attributes via new and update_attributes methods.

    See the rails guide on security for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
Trying to use WMI to obtain a list of installed programs for Windows XP.
I am trying use an iterator to go through a set and then do
I am trying use the django ORM to get a list by year of
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying use a Java Uploader in a ROR app (for its ease
Hi I'm trying use a datepicker on a field I have. I'm trying to
Trying to use this method (gist of which is use self.method_name in the FunnyHelper

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.