My Rails project has a navigation bar set up like this:
<nav>
<%= link_to "Home", root_url %> |
<%= form_tag "/posts", :method => 'get' do %>
<%= search_field_tag 'search', nil, :placeholder => 'Find...' %>
<% end %>
<%= link_to "Sign Up", new_user_url %> |
<%= link_to "Sign In", sign_in_url %&%gt;
</nav>
Currently, the navigation items are displayed on separate lines, with the search bar appearing alone. When inspecting the form element, it seems to be taking up the entire width of the page. I've attempted fixing this by wrapping the form tag in a div with display: inline
and setting its width manually, but neither solution worked. How can I ensure that all elements appear on the same line within the navigation bar?