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 8747793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:24:58+00:00 2026-06-13T12:24:58+00:00

As my log file shows, when you submit a form in my app, the

  • 0

As my log file shows, when you submit a form in my app, the parameters are being established correctly, but they are not saving in my database. This is only happening with two parameters, which are used with a dropdown form.

Here is my logger:

Processing by UsersController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"tIdsWBUB+ik8eeOOxUEQs9mSB/WiSyX2Gkw3/fAw64w=", "user"=>   {"name"=>"Jeffgo", "email"=>"JeffreyEricKatz6@gmail.com", "cell_number"=>"5554595515", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "day_open"=>"0", "time_open"=>"14"}, "commit"=>"Create my account"}

RecordedLesson Load (0.1ms)  SELECT "recorded_lessons".* FROM "recorded_lessons" LIMIT 1
(0.1ms)  SELECT 1 FROM "users" WHERE LOWER("users"."email") = LOWER('JeffreyEricKatz6@gmail.com') LIMIT 1

Binary data inserted for `string` type on column `password_digest`
SQL (51.2ms)  INSERT INTO "users" ("cell_number", "created_at", "day_open", "email",    "last_class", "name", "password_digest", "recorded_lesson_id", "test", "time_available", "time_open", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [["cell_number", "2154997415"], ["created_at", Sun, 28 Oct 2012 16:45:50 EDT -04:00], ["day_open", nil], ["email", "jeffreyerickatz6@gmail.com"], ["last_class", 0], ["name", "Jeffgo"], ["password_digest", "$2a$10$Idl8H7tMvotqhwiFteya2eSUaNEdAPNU6dqrp5PPalEyfo7w6x5gq"], ["recorded_lesson_id", 1], ["test", nil], ["time_available", nil], ["time_open", nil], ["type", nil], ["updated_at", Sun, 28 Oct 2012 16:45:50 EDT -04:00]]'

Ok, now here is the part of the form:
<% provide(:title, “Sign up”) %>

Sign up

<div class="row">
<div class="span6 offset3">
<%= simple_form_for @user do |f| %>
<%= render 'shared/user_error_messages' %>

<%= f.label :name %>
<%= f.text_field :name %>

<%= f.label :email %>
<%= f.text_field :email %>

<%= f.label :cell_number %>
<%= f.text_field :cell_number, :hint => '5555555555' %>

<%= f.label :password %><br />
<%= f.password_field :password %>


<%= f.label :password_confirmation, "Confirmation" %><br />
<%= f.password_field :password_confirmation %>

<%= f.label :day_open %> <br />
<%= f.select("day_open", {"Sunday" => "0", "Monday" => "1", "Tuesday" => "2", "Wednesday" => "3", "Thursday" => "4", "Friday" => "5", "Saturday" => "6"}) %>

<%= f.label :time_open %> <br />
<%= f.select("time_open", {"7:30 pm" => "14", "8:30 pm" => "15", "9:30 pm" => "16"}) %>
<div class="actions">
 <%= f.submit "Create my account" %>
 </div>

 <% end %>

 </div>
 </div>

My controller:

class UsersController < ApplicationController
def new
  @title = "Sign up"
  @user = User.new 
end


def create
 @user = User.new(params[:user])
 if @user.save
   flash[:success] = "Welcome to the Sample App!"
   redirect_to @user
  else
    @title = "Sign up"
    render 'new'
  end
 end
end

finally, here is my model:

class User < ActiveRecord::Base
has_many :tutoring_sessions
belongs_to :recorded_lesson
attr_accessor :day_open, :time_open
attr_accessible :name, :email, :cell_number, :password, :password_confirmation, 
    :day_open, :time_open, :tutoring_sessions_attributes, :recorded_lesson_id
has_secure_password
accepts_nested_attributes_for :tutoring_sessions, :allow_destroy => true

before_save { |user| user.email = email.downcase }

validates :name, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email,  format: { with: VALID_EMAIL_REGEX }, 
uniqueness: { case_sensitive: false}
validates :password, presence: true, length: { minimum: 6}, on: :create
validates :password_confirmation, presence: true, on: :create
after_initialize :init

def init
  self.recorded_lesson_id ||= RecordedLesson.first.id
  self.last_class ||= 0
end

def advance
    if self[:recorded_lesson_id] == nil
        self[:recorded_lesson_id] = RecordedLesson.first.id
    else
        self[:recorded_lesson_id] += 1
    end
    #self.save
end





    def nows_weekday 
        @todays_weekday = Time.now.utc.wday
    end

    def number_of_days_from_now
        (selected_day - nows_weekday)
    end



    def is_student?
        self[:type] == 1
     end

   def is_tutor?
       self[:type] == 0
   end

   def set_day_and_time_available
      set_hour = Time.now.utc.change(:hour => selected_time)
      set_day  = set_first_day_of_session(set_hour)
      self[:time_available] ||= set_day.to_datetime
   end

   def set_first_day_of_session(set_hour)
       if selected_day > nows_weekday #(Eg. Today is Tuesday and chooses wednesday)
       first_day_of_session= set_hour.advance(:days => number_of_days_from_now)
       else #(Eg. Today is Tuesday and chooses Monday)
          first_day_of_session= set_hour.advance(:days => (number_of_days_from_now + 7))
       end
   end
 end
  • 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-13T12:25:00+00:00Added an answer on June 13, 2026 at 12:25 pm

    remove the line attr_accessor :day_open, :time_open
    It’s overriding, existing accessors created by ActiveRecord

    this is the same issue than this one

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

Sidebar

Related Questions

Given a txt log file, which is in the form: USER_A timestamp1 otherstuff USER_B
Copied from my log file ActionView::Template::Error (Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs
I'm trying to show test run log (text file in a windows server) to
I have a log file that I'm trying to append data to the end
I have a log file that I am reading to a string public static
I have a log file in SqlServer that stores the time an application started,
I have a log file containing statistics from different servers. I am separating the
I have a transaction log file in CSV format that I want use to
I have a huge log file where there are about 15 million lines. I
C# in MS Visual Studio 2010. I am writing output to a log file

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.