Skip to content

Commit

Permalink
Add kana list and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zmack committed Sep 11, 2009
1 parent d6ec64a commit 3cece3e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/controllers/sightings_controller.rb
@@ -1,6 +1,10 @@
class SightingsController < ApplicationController
before_filter :require_user

def index
@kanas = Kana.all
end

def create
@sighting = Sighting.new(params[:sighting].merge(:user_id => current_user.id))
@sighting.save!
Expand Down
8 changes: 4 additions & 4 deletions app/views/layouts/application.html.haml
Expand Up @@ -5,15 +5,15 @@
= stylesheet_link_tag 'application'
= yield :head
%body
.header
#header
%h1 Can you kana ?
%ul.navigation
%ul#navigation
%li List that kana !
.current_user
#current_user
Logged in as
= current_user.login
= yield :layout
/ Now we include the javascripts !
= javascript_include_tag 'jquery-1.3.2'
= javascript_include_tag 'jquery-1.3.2', 'application'
= yield :javascript

3 changes: 3 additions & 0 deletions app/views/sightings/_kana_item.html.haml
@@ -0,0 +1,3 @@
%li{ :id => "kana-#{kana_item.id}" }
%em= kana_item.char
%span== ( #{kana_item.romaji} )
13 changes: 13 additions & 0 deletions app/views/sightings/index.html.haml
@@ -0,0 +1,13 @@
- content_for :javascript do
= javascript_include_tag 'kana_quiz'

- form_tag nil, :id => 'check_kana' do
%p#kana
= text_field_tag :romaji
= submit_tag 'Is it ?'

- form_tag(nil, :id => 'pick_kanas') do
= submit_tag 'Start', :id => 'start'
%ul
= render :partial => 'kana_item', :collection => @kanas

0 comments on commit 3cece3e

Please sign in to comment.