typed-parameter:在Rails中使用强参数创建类型化的参数类

时间:2021-03-07 22:04:44
【文件属性】:
文件名称:typed-parameter:在Rails中使用强参数创建类型化的参数类
文件大小:19KB
文件格式:ZIP
更新时间:2021-03-07 22:04:44
Ruby 类型参数 在rails中使用强参数创建类型化的参数类。 您可以在控制器中清除允许的参数代码,并将其转换为所需的类型。 安装 将此行添加到您的应用程序的Gemfile中: gem 'typed-parameter' 然后执行: $ bundle install 或将其自己安装为: $ gem install typed-parameter 用法 例子1.键入convert class UserCreateParams < TypedParamter :: Base field :name , String field :age , Integer field :email , String end ----------------------------------------------- ############ ## before ## ############
【文件预览】:
typed-parameter-master
----bin()
--------console(350B)
--------setup(131B)
----Rakefile(51B)
----.rubocop.yml(1KB)
----typed_parameter.gemspec(2KB)
----Gemfile(123B)
----spec()
--------typed_parameter_spec.rb(875B)
--------typed_parameter.gemspec(2KB)
--------typed_parameter_model_spec.rb(2KB)
--------spec_helper.rb(253B)
----.ruby-version(6B)
----.gitignore(126B)
----CHANGELOG.md(43B)
----lib()
--------typed_parameter()
--------typed_parameter.rb(602B)
----README.md(4KB)

网友评论