Skip to content

Commit

Permalink
adding items show
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Silvis authored and Mike Silvis committed Sep 3, 2012
1 parent 057cbec commit 922b0ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/app/views/items/index.jst.eco
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<option value="7">Desert</option>
</select>
</div>
<div class="span4" style="width:306px;">
<div class="span4" style="width:260px;">
<input type="text" placeholder="What?" id="item" class='input-full' name="name">
</div>
<div class="span2">
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/api/v1/items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ def index
@items = Item.where(event_id: params[:event_id]).includes(:user)
end

def show
@item = Item.where(params[:id]).includes(:user).first
end

def create
@item = Item.create(event_id: params[:event_id],
user_id: current_user.id,
Expand Down
1 change: 1 addition & 0 deletions app/views/api/v1/items/show.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
json.partial! @item

0 comments on commit 922b0ca

Please sign in to comment.