Skip to content

Commit

Permalink
added faqs model and created table. created some faqs in db using mig…
Browse files Browse the repository at this point in the history
…ration. updated faqs page to use questions from db

staged faq files
  • Loading branch information
nitindhar7 committed Jun 30, 2011
1 parent 579630c commit 05ef359
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 35 deletions.
4 changes: 4 additions & 0 deletions app/controllers/dashboard_controller.rb
Expand Up @@ -21,4 +21,8 @@ def features
redirect_to :back, :notice => "List of features coming soon!"
end

def faqs
@faqs = Faq.find( :all )
end

end
2 changes: 2 additions & 0 deletions app/models/faq.rb
@@ -0,0 +1,2 @@
class Faq < ActiveRecord::Base
end
34 changes: 6 additions & 28 deletions app/views/dashboard/faqs.html.erb
@@ -1,31 +1,9 @@
<div id="faqs">
<div class="title">FREQUENTLY ASKED QUESTIONS</div>
<div class="faq">
<div class="question">How would you describe BucketRead in less than 10 words?</div>
<div class="answer">A simple bookmarking service that helps you get organized.</div>
</div>
<div class="faq">
<div class="question">What do I need to get started?</div>
<div class="answer">All you need is a valid email address.</div>
</div>
<div class="faq">
<div class="question">What's this business of 'locking' and 'unlocking' a link?</div>
<div class="answer">The purpose of BucketRead is to allow you to organize links. After you read an article on a link you can 'lock' is so that it becomes archived. Links that are unlocked are the ones you want to read.</div>
</div>
<div class="faq">
<div class="question">Can 'locked' links be 'unlocked'?</div>
<div class="answer">Yes, the purpose of locking a link is to mark it off as read. 'locked' links can be revisited by unlocking them.</div>
</div>
<div class="faq">
<div class="question">Can I 'drag and drop' a site to read later to save it?</div>
<div class="answer">At the moment, URLs have to be copy/pasted. The BucketRead chrome extension will allow a 1-click solution to this.</div>
</div>
<div class="faq">
<div class="question">I am a developer, can I integrate BucketRead into my app?</div>
<div class="answer">Yes. Check the BucketRead API documentation for information on how to authorize and link your app.</div>
</div>
<div class="faq">
<div class="question">My question was not answered here!</div>
<div class="answer">Apologies. Please get in touch by sending us your question on bucketread AT basedataapp.com</div>
</div>
<% for faq in @faqs %>
<div class="faq">
<div class="question"><%= faq.question %></div>
<div class="answer"><%= faq.answer %></div>
</div>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/users/login.html.erb
@@ -1,7 +1,7 @@
<div id="main_content_wrapper">
<div id="main_content">
<% form_tag authorize_path, :method => :post, :id => "login_form" do %>
<div class="title">Login in to BucketRead</div>
<div class="title">Login to BucketRead</div>
<div class="content">
<%= label_tag :email %>
<%= text_field_tag :email, params[:email], :class => "field" %>
Expand Down
14 changes: 14 additions & 0 deletions db/migrate/20110630090256_create_faqs.rb
@@ -0,0 +1,14 @@
class CreateFaqs < ActiveRecord::Migration
def self.up
create_table :faqs do |t|
t.string :question, :null => false
t.string :answer, :null => false

t.timestamps
end
end

def self.down
drop_table :faqs
end
end
10 changes: 10 additions & 0 deletions db/migrate/20110630090617_load_faqs.rb
@@ -0,0 +1,10 @@
require 'active_record/fixtures'

class LoadFaqs < ActiveRecord::Migration
def self.up
Fixtures.create_fixtures('test/fixtures', File.basename("faqs.yml", '.*'))
end

def self.down
end
end
9 changes: 8 additions & 1 deletion db/schema.rb
Expand Up @@ -9,7 +9,14 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20110607144658) do
ActiveRecord::Schema.define(:version => 20110630090617) do

create_table "faqs", :force => true do |t|
t.string "question", :null => false
t.string "answer", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "pages", :force => true do |t|
t.string "url", :limit => 200, :null => false
Expand Down
7 changes: 5 additions & 2 deletions public/stylesheets/dashboard.css
Expand Up @@ -453,12 +453,15 @@
*/
#faqs {
margin: auto;
margin-top: 10px;
padding: 20px;
width: 860px;
border: 1px solid #DDD;
background: #EEE;
background: #F0F0FF;
border: 1px solid #FFF;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 0 0 1px #333;
-webkit-box-shadow: 0 0 1px #333;
}

#faqs .title {
Expand Down
6 changes: 3 additions & 3 deletions public/stylesheets/users.css
Expand Up @@ -23,7 +23,7 @@
#login_form .title,
#account .title {
padding: 10px;
width: 578px;
width: 878px;
height: 49px;
line-height: 49px;
color: #900;
Expand All @@ -37,14 +37,14 @@
#login_form .content,
#account .content {
padding: 20px;
width: 558px;
width: 858px;
border-top: 1px solid #CCC;
}

#new_user .content label,
#login_form .content label,
#account .content label {
width: 558px;
width: 858px;
height: 30px;
line-height: 30px;
font-size: 16px;
Expand Down
27 changes: 27 additions & 0 deletions test/fixtures/faqs.yml
@@ -0,0 +1,27 @@
faq1:
question: How would you describe BucketRead in less than 10 words?
answer: A simple bookmarking service that helps you get organized.

faq2:
question: What do I need to get started?
answer: All you need is a valid email address.

faq3:
question: What's this business of 'locking' and 'unlocking' a link?
answer: The purpose of BucketRead is to allow you to organize links. After you read an article on a link you can 'lock' is so that it becomes archived. Links that are unlocked are the ones you want to read.

faq4:
question: Can 'locked' links be 'unlocked'?
answer: Yes, the purpose of locking a link is to mark it off as read. 'locked' links can be revisited by unlocking them.

faq5:
question: Can I 'drag and drop' a site to read later to save it?
answer: At the moment, URLs have to be copy/pasted. The BucketRead chrome extension will allow a 1-click solution to this.

faq6:
question: I am a developer, can I integrate BucketRead into my app?
answer: Yes. Check the BucketRead API documentation for information on how to authorize and link your app.

faq7:
question: My question was not answered here!
answer: Apologies. Please get in touch by sending us your question on bucketread AT basedataapp.com
8 changes: 8 additions & 0 deletions test/unit/faq_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class FaqTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

0 comments on commit 05ef359

Please sign in to comment.