![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Provides support for validating, storing and retrieving phone, mobile, fax numbers with ISD code.
Add this line to your application's Gemfile:
gem 'has_contact_number'
And then execute:
$ bundle
Add columns for required contact_number attributes in table.
Define contact number attributes/columns in model where you have columns like phone_number, mobile_number, fax_number, etc.
contact_number_attributes :column1, :column2, :columnN
For example:
class Contact < ActiveRecord::Base
contact_number_attributes :phone_number, :mobile_number, :fax_number
end
Use method contact_number_attributes to generate list of attributes to be permitted.
For example:
class ContactsController < ApplicationController
def contact_params
params.require(:contact).permit(
*contact_number_attributes(:phone_number, :mobile_number, :fax_number), # Other attributes
)
end
end
Note: Pay attention to usage of splat operator (*
) prefixed to contact_number_attributes
You can add select list for ISD code of contact_number attribute using collection options_for_isd_code_select and text field for contact_number attribute.
For example: If you have phone_number attribute then following should be your view code (For HAML)
= f.select :phone_number_isd_code, options_for_isd_code_select, prompt: 'Select'
= f.text_field :phone_number_without_isd_code, placeholder: 'Phone Number'
You can use any FormBuilder like SimpleForm as
= f.input :phone_number_isd_code, collection: options_for_isd_code_select, prompt: 'Select'
= f.input :phone_number_without_isd_code, placeholder: 'Phone Number'
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/has_contact_number. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that has_contact_number demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.