ruby on rails - Cant show the invitation box for inviting in homepage -
i want make beta invites. cant see invitation form on homepage.
/static_pages/home.html.erb:( shortly)
<% if signed_in? %> <div class="row"> <aside class="span2"> <section> <%= render 'shared/invitation_form' %> </section> </aside> <div class="span6 hero-unit"> <ol class="topics-signedin"> <%= render 'shared/topics' %> </ol> </div> </div> <% else %> <div class="row"> <div class="span10"> <div class="center hero-unit"> <h2>giripedia</h2> <ol class="topics"> <%= render 'shared/topics' %> </ol> <%= link_to "Üye olun!", signup_path, class: "btn btn-large btn-primary center" %> <p>sitemiz ş....</p> <% form_for invitation.new |f| %> <p> <%= f.label :recipient_email, "emailiniz:" %> <%= f.text_field :recipient_email %> <%= f.submit 'gönder' %> </p> <% end %> </div> </div> <% end %> rake routes :
new_invitation /invitations/new(.:format) invitations#new edit_invitation /invitations/:id/edit(.:format) invitations#edit invitation /invitations/:id(.:format) invitations#show put /invitations/:id(.:format) invitations#update delete /invitations/:id(.:format) invitations#destroy my static_pages_controller.rb:
def home if signed_in? @topic = current_user.topics.build if signed_in? end @topics = topic.paginate :page => params[:page], :per_page => 20 @invitation = invitation.new end and _invitation_form.html.erb:
<% form_for @invitation |f| %> <p> <%= f.label :recipient_email, "arkadaşının email adresi" %><br /> <%= f.text_field :recipient_email %> </p> <p><%= f.submit "davet et!" %></p> <% end %> the logs show :
(0.1ms) select count(*) "topics" "topics"."user_id" = 1 rendered shared/_user_info.html.erb (2.4ms) rendered shared/_error_messages.html.erb (0.4ms) rendered shared/_topic_form.html.erb (2.9ms) rendered shared/_invitation_form.html.erb (1.8ms) topic load (0.1ms) select "topics".* "topics" order topics.created_at desc limit 20 offset 0.. but not show user.form.do have idea?
you're missing = in _invitation_form.html.erb. try:
<%= form_for @invitation |f| %> <p> <%= f.label :recipient_email, "arkadaşının email adresi" %><br /> <%= f.text_field :recipient_email %> </p> <p><%= f.submit "davet et!" %></p> <% end %> likewise @ <% form_for ... %> line in home.html.erb
Comments
Post a Comment