开发者

Why is my button not appearing on the page?

开发者 https://www.devze.com 2023-02-24 12:15 出处:网络
I have this form in a partial: <%= form_for current_user.relationships.build(:followed_id => @profile.user.id) do |f| %>

I have this form in a partial:

<%= form_for current_user.relationships.build(:followed_id => @profile.user.id) do |f| %>
  <div><%= f.hidden_field :followed_id %></div>
  <div class="follow_button"><%= f.submit "Follow" %></div>
<% end %>

that is rendered to my profile view. Here is the resulting html:

<form accept-charset="UTF-8" action="/relationships" class="new_relationship" id="new_relationship" method="post">
    <div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓">
    <input name="authenticity_token" type="hidden" value="fo9dve4XjKpqSHqkmYw/lsEPm4PUxRYy+5JM5D4aTLg="></div>
    <div><input id="relationship_followed_id" name="relationship[followed_id]" type="hidden" va开发者_JS百科lue="58"></div>
    <div class="follow_button"><input id="relationship_submit" name="commit" type="submit" value="Follow"></div>
</form>

The form is there, and the css display attribute for the button is not hidden, so why is the button not appearing?


Perhaps something else in your CSS file is causing the submit button to be hidden. Try disabling your CSS styles for the entire page and see if the button is still hidden.


try removing the CSS class "follow_button" from the button. If the button then appears. Then the problem is in the styles.

Good luck!


I had an issue with my buttons one time, then I realized that I had not linked my html and css for the specific tab I wanted to have a button. So always make sure to double check that

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号