0

I have a namespaced admin set up where I create Clients and prefill all of their information. When the client visits the site all they need to do is type in a code that was previously emailed to them, and they can access the site. The problem I have is that when i create the client, I generate this code. So it already exists in the db. So when i try to make an input form for the client

using

   <%= simple_form_for @client, :method => "get"  do |f| %>
        <%= f.input :code , label: false %>
        <%= f.submit %>
   <% end %>

the input field is prepopulated, .. im going to assume it is because it already exists in the database, but really i was to query the db upon submission, and then go on to set up some info in a session variable, .. what am i missing in the form or otherwise to make this a query and not just a prepopulated input?

1 Answer 1

2

Fill in the field yourself so that it's not prepopulated.

:input_html key in options allows you to specify attributes for corresponding <input> element as said on the SimpleForm's website, Usage section.

<%= f.input :code , label: false, input_html: { value: '' } %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.