diff --git a/app/controllers/friend_requests_controller.rb b/app/controllers/friend_requests_controller.rb index 3cb6a1b2b..fa2cd81dc 100644 --- a/app/controllers/friend_requests_controller.rb +++ b/app/controllers/friend_requests_controller.rb @@ -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 diff --git a/app/views/friend_requests/_form.html.haml b/app/views/friend_requests/_form.html.haml index e62bd4531..1841efd8a 100644 --- a/app/views/friend_requests/_form.html.haml +++ b/app/views/friend_requests/_form.html.haml @@ -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 diff --git a/app/views/friend_requests/_friend_request.html.haml b/app/views/friend_requests/_friend_request.html.haml index 9e58d056f..c906e67a1 100644 --- a/app/views/friend_requests/_friend_request.html.haml +++ b/app/views/friend_requests/_friend_request.html.haml @@ -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 diff --git a/app/views/friend_requests/_new_friend_request.haml b/app/views/friend_requests/_new_friend_request.haml index 0195ccbed..598f718d2 100644 --- a/app/views/friend_requests/_new_friend_request.haml +++ b/app/views/friend_requests/_new_friend_request.haml @@ -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 diff --git a/app/views/friend_requests/show.html.haml b/app/views/friend_requests/show.html.haml index 4b22ba43a..72cba82bd 100644 --- a/app/views/friend_requests/show.html.haml +++ b/app/views/friend_requests/show.html.haml @@ -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