forked from misselliev/facebook-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request misselliev#17 from misselliev/posts-V2
Posts v2
- Loading branch information
Showing
16 changed files
with
88 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
<%= form_for(@post, :html => {:class => "ui form ten wide column"}) do |f| %> | ||
<br> | ||
<%= form_for(@post, from: locals[:from], object: locals[:object], html: { class: "ui form" }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: @post %> | ||
<div class="field"> | ||
<%= f.text_area :content, placeholder: "Write your post here..." %> | ||
</div> | ||
<%= hidden_field_tag 'friend_id', locals[:object].id %> | ||
<%= hidden_field_tag 'from', locals[:from] %> | ||
<% if locals[:from] == 'index' %> | ||
<%= f.text_area :content, placeholder: "Write your post here...", style: "height: 30px" %> | ||
<% elsif locals[:from] == 'user' && locals[:object] != current_user %> | ||
<%= f.text_area :content, placeholder: "Write a post to #{locals[:object].name}", style: "height: 30px" %> | ||
<% else %> | ||
<%= f.text_area :content, placeholder: "Write your post here...", style: "height: 30px" %> | ||
<% end %> | ||
|
||
<br> | ||
<div class="ui centered grid actions"> | ||
<%= f.submit "Post", class: 'medium ui teal basic button' %> | ||
</div> | ||
<%= f.submit "Post", class: 'medium ui teal basic fluid button'%> | ||
<br> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddFriendIdToPost < ActiveRecord::Migration[5.2] | ||
def change | ||
add_column :posts, :friend_id, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddFkToFriendIdInPost < ActiveRecord::Migration[5.2] | ||
def change | ||
add_foreign_key :posts, :users, column: :friend_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters