Permalink
Browse files

Wanna help feature basics.

  • Loading branch information...
1 parent 8a18121 commit ae73195a11d544c2924f5e6dd3030c7a54984121 @orendon orendon committed Sep 30, 2012
Showing with 19 additions and 3 deletions.
  1. +12 −0 app/controllers/wannahelp_controller.rb
  2. +7 −3 app/views/wannahelp/index.html.erb
@@ -3,4 +3,16 @@ class WannahelpController < ApplicationController
def index
@repos = Repo.limit(5)
end
+
+ def update
+ repo = Repo.find(params[:id])
+ star(repo.user, repo.name)
+ redirect_to user_wannahelp_index_path(current_user)
+ end
+
+ private
+ def star(user, repo)
+ github = Github.new basic_auth: 'gomayonqui:desarrollo1'
+ github.repos.starring.starred(owner: 'orendon', repo: 'ruby-shop')
+ end
end
@@ -4,11 +4,15 @@
<tr>
<th>Repo</th>
<th>Author</th>
+ <th>Actions</th>
</tr>
<tr>
<%- @repos.each do |repo| %>
- <td><%= repo.name %></td>
- <td><%= repo.user.name %></td>
- <% end%>
+ <%= form_tag(user_wannahelp_path(current_user, repo), method: :put) do %>
+ <td><%= repo.name %></td>
+ <td><%= repo.user.name %></td>
+ <td><%= submit_tag %></td>
+ <% end %>
+ <% end %>
</tr>
</table>

0 comments on commit ae73195

Please sign in to comment.