Permalink
Browse files

Feature: Added users route.

  • Loading branch information...
1 parent 276f436 commit da7ab4de2e1ae864567d78096eb828f14f9bc3a0 @hrdwdmrbl committed Mar 23, 2013
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+// Place all the styles related to the Users controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
+class UsersController < InheritedResources::Base
+ respond_to :json
+end
@@ -0,0 +1,2 @@
+module UsersHelper
+end
View
@@ -1,5 +1,5 @@
class Prediction < ActiveRecord::Base
- attr_accessible :end_date, :name, :prediction, :source, :verified_by
+ attr_accessible :end_date, :name, :prediction, :source, :verified_by, :user_id
has_many :sells
has_many :buys
has_many :transactions
@@ -15,6 +15,7 @@
.field
= f.label :prediction
= f.text_area :prediction
+ = f.hidden_field :user_id, :value => current_user.id
.field
= f.label :source
= f.text_field :source
View
@@ -19,6 +19,8 @@
devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks"}
+ resources :users
+
root :to => "predictions#index"
# The priority is based upon order of creation:
# first created -> highest priority.
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UsersHelperTest < ActionView::TestCase
+end

0 comments on commit da7ab4d

Please sign in to comment.