Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Feature: Added users route.

  • Loading branch information...
commit da7ab4de2e1ae864567d78096eb828f14f9bc3a0 1 parent 276f436
Marc authored
3  app/assets/javascripts/users.js.coffee
View
@@ -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/
3  app/assets/stylesheets/users.css.scss
View
@@ -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/
3  app/controllers/users_controller.rb
View
@@ -0,0 +1,3 @@
+class UsersController < InheritedResources::Base
+ respond_to :json
+end
2  app/helpers/users_helper.rb
View
@@ -0,0 +1,2 @@
+module UsersHelper
+end
2  app/models/prediction.rb
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
1  app/views/predictions/_form.html.haml
View
@@ -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
2  config/routes.rb
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.
7 test/functional/users_controller_test.rb
View
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
4 test/unit/helpers/users_helper_test.rb
View
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UsersHelperTest < ActionView::TestCase
+end
Please sign in to comment.
Something went wrong with that request. Please try again.