DG IZ fixed views for friend request

This commit is contained in:
ilya 2010-07-06 14:48:44 -04:00
parent 0587688d18
commit 9cddf26a53
5 changed files with 23 additions and 33 deletions

View file

@ -20,13 +20,16 @@ class FriendRequestsController < ApplicationController
def new def new
@friend_request = FriendRequest.new @friend_request = FriendRequest.new
@receiver = Person.new @recipient = Person.new
end end
def create def create
puts params.inspect
@friend_request = FriendRequest.new(params[:friend_request]) @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 if @friend_request.save

View file

@ -2,7 +2,7 @@
= f.error_messages = f.error_messages
= f.fields_for :receiver do |r| = f.fields_for :recipient do |r|
%p %p
= r.label :email = r.label :email
= r.text_field :email = r.text_field :email

View file

@ -1,18 +1,2 @@
%li.message{:id => post.id, :class => ("mine" if mine?(post))} %li.message{:id => post.id}
%span.from = post.inspect
= 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

View file

@ -1,7 +1,7 @@
= form_for @friend_request, :remote => true do |f| = form_for @friend_request, :remote => true do |f|
= f.error_messages = f.error_messages
= f.fields_for :receiver do |r| = f.fields_for :recipient do |r|
%p %p
= r.label :email = r.label :email
= r.text_field :email = r.text_field :email

View file

@ -1,18 +1,21 @@
- title "Bookmark" - title "Friend Request"
%p %p
%strong Title: %strong Recipient:
= @bookmark.title = @friend_request.recipient.email
%p %p
%strong Link: %strong URL:
= link_to @bookmark.link = @friend_request.recipient.url
%p %p
%strong Owner: %strong Sender:
= @bookmark.person.real_name = @friend_request.sender.email
%p
%strong URL:
= @friend_request.sender.url
%p %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