Reputation: 2584
I have a form produced by simple_form gem. All works fine. This is the html of my form:
<form accept-charset="UTF-8" action="/contacts" class="simple_form new_contact" id="new_contact" method="post" novalidate="novalidate">
If I type in the browser http://localhost:3000/contacts#new_contact
everything works fine: I'm redirect to the form in the bottom of page.
Is possible render the link http://localhost:3000/contacts#new_contact
in the controller with the render
method?
Something like this:
#contacts_controller.rb
render 'contacts#new_contact'
EDIT
Rendering the Contacts index
page with the following link:
<%= navbar_item "Contact", contacts_path %>
Upvotes: 0
Views: 72
Reputation: 53028
Change the Contacts form on Contacts index page as:
<%= simple_form_for @message, url: contacts_path(anchor: 'new_contact') ,defaults: { label: false} do |f| %>
Pass the url
option along with anchor
in the form
.
Upvotes: 2