Search code examples
ruby-on-railssimple-formrails-i18n

Changing simple_form submit button i18n text


This is my code:

<%= simple_form_for [:backend, @department] do |f| %>
  <%= f.input :parentid, input_html: { class: 'form-control' } %>
  <%= f.input :name, input_html: { class: 'form-control' }  %>
  <%= f.button :submit %>
<% end %>

This is my form and I want to change the submit text, now the text is create department, so I tried:

zh-CN:
  simple_form:
    helpers:
      submit:
        department:
          create: "新建部门"
          update: "保存编辑"

but nothing changed. How can I change it?


Solution

  • I add a gem i18n-debug, then I restart server and flash the page. Look the terminal log , I know what is the problem。 enter image description here so, after zh-CN is helpers, not simple_form