-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing View Helpers From Templates #140
Comments
Also: = simple_form_for User.new(first_name: '{{first_name}}', last_name: '{{last_name}}') do |f|
= f.input :first_name
= f.input :last_name <form novalidate="novalidate" class="simple_form new_user" id="new_user" action="/users" accept-charset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓" /><input type="hidden" name="authenticity_token" value="XRvodW7AhzpZRMgzYfQazRP3XzNU5MCFzAke2UmQHbfHotfFmCLqlV4zlk7cYbwiChgGx8g8/ZJ1ZNO6p40W3w==" />
<div class="form-group string optional user_first_name">
<label class="string optional control-label" for="user_first_name">First name</label>
<input class="string optional form-control" type="text" value="{{first_name}}" name="user[first_name]" id="user_first_name" />
</div>
<div class="form-group string optional user_last_name">
<label class="string optional control-label" for="user_last_name">Last name</label>
<input class="string optional form-control" type="text" value="{{last_name}}" name="user[last_name]" id="user_last_name" />
</div>
</form> This would work fine in slimbars. The only thing that would require jQuery / whatever is the authenticity_token. |
I am willing to accept PR for this, I just don't have the time right now to develop it 😞 |
Fair enough. I should learn more about the internals of Rails anyway. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is an issue (#89) with the same name. It has been closed with the argument that "View Helpers generally access non-constant data."
This is true for certain helpers. There are others:
Sure, certain options won’t work, like setting the "checked" with JSON and without jQuery. Still, having the Rails helpers would be a huge gain. I think most of the people who use this gem would be able to figure out what works and what doesn’t.
The text was updated successfully, but these errors were encountered: