DG IZ fixed views for friend request
This commit is contained in:
parent
0587688d18
commit
9cddf26a53
5 changed files with 23 additions and 33 deletions
|
|
@ -20,13 +20,16 @@ class FriendRequestsController < ApplicationController
|
|||
|
||||
def new
|
||||
@friend_request = FriendRequest.new
|
||||
@receiver = Person.new
|
||||
@recipient = Person.new
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
puts params.inspect
|
||||
|
||||
@friend_request = FriendRequest.new(params[:friend_request])
|
||||
@friend_request.sender = Person.new( :email => User.first.email, :url => User.first.url )
|
||||
puts
|
||||
puts
|
||||
puts params.inspect
|
||||
|
||||
|
||||
if @friend_request.save
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
= f.error_messages
|
||||
|
||||
|
||||
= f.fields_for :receiver do |r|
|
||||
= f.fields_for :recipient do |r|
|
||||
%p
|
||||
= r.label :email
|
||||
= r.text_field :email
|
||||
|
|
|
|||
|
|
@ -1,18 +1,2 @@
|
|||
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
|
||||
%span.from
|
||||
= link_to_person post.person
|
||||
%b shared a link
|
||||
%br
|
||||
= post.title
|
||||
|
||||
%a{:href => "#{post.link}"}
|
||||
= post.link
|
||||
%div.time
|
||||
= link_to(how_long_ago(post), bookmark_path(post))
|
||||
\--
|
||||
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
|
||||
= render "comments/comments", :post => post
|
||||
|
||||
- if mine?(post)
|
||||
.destroy_link
|
||||
= link_to 'Delete', bookmark_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true
|
||||
%li.message{:id => post.id}
|
||||
= post.inspect
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
= form_for @friend_request, :remote => true do |f|
|
||||
= f.error_messages
|
||||
|
||||
= f.fields_for :receiver do |r|
|
||||
= f.fields_for :recipient do |r|
|
||||
%p
|
||||
= r.label :email
|
||||
= r.text_field :email
|
||||
|
|
|
|||
|
|
@ -1,18 +1,21 @@
|
|||
- title "Bookmark"
|
||||
- title "Friend Request"
|
||||
|
||||
%p
|
||||
%strong Title:
|
||||
= @bookmark.title
|
||||
%strong Recipient:
|
||||
= @friend_request.recipient.email
|
||||
%p
|
||||
%strong Link:
|
||||
= link_to @bookmark.link
|
||||
%strong URL:
|
||||
= @friend_request.recipient.url
|
||||
%p
|
||||
%strong Owner:
|
||||
= @bookmark.person.real_name
|
||||
%strong Sender:
|
||||
= @friend_request.sender.email
|
||||
%p
|
||||
%strong URL:
|
||||
= @friend_request.sender.url
|
||||
|
||||
%p
|
||||
= link_to "Edit", edit_bookmark_path(@bookmark)
|
||||
= link_to "Edit", edit_friend_request_path(@bookmark)
|
||||
|
|
||||
= link_to "Destroy", @bookmark, :confirm => 'Are you sure?', :method => :delete
|
||||
= link_to "Destroy", @friend_request, :confirm => 'Are you sure?', :method => :delete
|
||||
|
|
||||
= link_to "View All", bookmarks_path
|
||||
= link_to "View All", friend_requests_path
|
||||
|
|
|
|||
Loading…
Reference in a new issue