thoughtbot / thoughtbot/form_props

Unchecked value should always be a string if not null

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
50
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This makes it consistent with hidden input values in HTML. Which is how unchecked values are used.

Relevant snippet In check_box.rb,

module FormProps
  module Inputs
    class CheckBox < Base
      def initialize(object_name, method_name, template_object, checked_value, unchecked_value, options)
        @checked_value = checked_value
        @unchecked_value = unchecked_value
        super(object_name, method_name, template_object, options)
      end

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in check_box.rb at FormProps::Inputs::CheckBox#initialize, where @checked_value and @unchecked_value are assigned. Trace how the unchecked value is rendered and verify the behavior against the issue's HTML hidden-input expectation. Done means every non-null unchecked value is represented as a string while null remains null.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.