我正在尝试使用text-field组件的mask属性,如下例所示.在视图中,它就像一个魅力,但是,当发布表单时,掩码格式不保留值.
例如,当我键入"000.000.000-00"时,表单发布的值为"00000000000".如何保持格式值?
<v-text-field
:value="currentValue"
@input="handleInput"
:mask="###.###.###-##"></v-text-field>
Run Code Online (Sandbox Code Playgroud) 我在财务模块中有以下模型:
class Finance::BillRec < ActiveRecord::Base
...
has_many :bill_rec_offs, :dependent => :destroy
...
end
class Finance::BillRecOff < ActiveRecord::Base
...
belongs_to :bill_rec
...
end
Run Code Online (Sandbox Code Playgroud)
我在我的form_for上这样做:
<%= form_for([@bill_rec, @bill_rec_off]) do |f| %>
...
<% end %>
Run Code Online (Sandbox Code Playgroud)
的routes.rb
namespace :finance do
resources :bill_recs do
resources :bill_rec_offs
end
end
Run Code Online (Sandbox Code Playgroud)
而错误:
undefined method `finance_bill_rec_finance_bill_rec_offs_path' for #<#<Class:0x000000070757e0>:0x0000000708bec8>
Run Code Online (Sandbox Code Playgroud)
但是,路线finance_bill_rec_bill_rec_off_path(@bill_rec_off)效果很好.
如何在带有命名空间的form_for和带有模块的嵌套路由上执行此操作?