Skip to content

Commit

Permalink
added home controller, added some documentation about API and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavk committed Jun 16, 2013
1 parent e752e05 commit e29f5f2
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/assets/javascripts/home.js.coffee
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions app/assets/stylesheets/home.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
5 changes: 5 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class HomeController < ApplicationController
def index

end
end
2 changes: 2 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module HomeHelper
end
51 changes: 51 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<h1>Welcome to Online NITH Information Portal</h1>
<p>The portal is planned to support various facilities online like online time
table, campus maps, online notices and stuff.</p>

<p>The html version of this portal is not well designed and this portal is
basically made for providing an API platform to mobile applications for
android, iOS and Windows Phone. The developers who are interested in using
this API for creating mobile applications that enhance user experience of
people with coressponding smart phones are most welcome to ask any queries
about the API and are allowed to use this API without any limits.</p>

<p>Your feedback regarding the API is also very much appreciated. We will take
full care of your feedback in enhancing the performance and qualify of our
JSON/XML objects passed to you via the API. Suggestions regarding the
improvements are also welcome.</p>

<p>Code will soon be available on github so that you can view openly, edit and
commit changes freely.</p>

<h2>Getting Started</h2>
<p><a href="/cseteachers">CSE Teachers</a></p>
<p><a href="/csesubjects">CSE Subjects</a></p>
<p><a href="/bcse6s">B.Tech CSE 6th semester Time table</a></p>

<h2>Usage</h2>
<p>The usage of this portal is from two perspectives, one from the point of
administrator, who can add information about various teachers and subjects of
his department and can edit the time table for his department for all
semesters. The teachers information and subject information need to be
entered by the representative of various departments in the college. So if
you are from Computer Science department and representing your department,
then you have to add information about teachers and subjects of your
department at once. Teachers and subjects which are compulsory but are not
from your department are also needed to be entered in this list. The
information about these two things you just entered will be available when
you will be creating the time table for students of your department for
various semester (thats why teachers and subjects of other departments are
also needed which are compulsory for students of your department to study, eg:
Princples of Management in 6th semester)</p>

<p>The other perspective of using this portal is from the your desktop/laptop
PC, you can view the time table in HTML format and other stuff.</p>

<p>Last but most important perspective is using the API to provide good
frontend to users of smartphones. Just append json to any end point and you
will get a JSON object instead of HTML. Fetch this object, parse and display
on your mobile phone application.</p>

<h2>TODO</h2>
<p>A mapping facility will also be added with API</p>
<p>A online notice facility is also desired with API</p>
4 changes: 3 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Nith::Application.routes.draw do

get "home/index"

match 'bcse6s/reset' => "bcse6s#reset"
match 'bcse6s/recreate' => "bcse6s#recreate"
match 'bcse6s/right' => "bcse6s#shiftright"
Expand Down Expand Up @@ -64,7 +66,7 @@

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'
root :to => 'home#index'

# See how all your routes lay out with "rake routes"

Expand Down
9 changes: 9 additions & 0 deletions test/functional/home_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'test_helper'

class HomeControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end

end
4 changes: 4 additions & 0 deletions test/unit/helpers/home_helper_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'test_helper'

class HomeHelperTest < ActionView::TestCase
end

0 comments on commit e29f5f2

Please sign in to comment.