Skip to content

Instantly share code, notes, and snippets.

View oseifrimpong's full-sized avatar
🎯
Focus

Obed Osei Frimpong oseifrimpong

🎯
Focus
View GitHub Profile
# == Schema Informationdescribe "when name is not present" do
# before { @user.name = " " }
# it { should_not be_valid }
# end
#
# Table name: users
#
# id :integer not null, primary key
# name :string(255)
# email :string(255)
@import "bootstrap";
/*mixins, variables, etc*/
$grayMediumLight: #eaeaea;
@mixin box_sizing {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
class LandingController < ApplicationController
layout 'landingPage'
def soon
@coming = Coming.new
end
<%= form_for(@coming, url: landing_soon_path) do |f| %>
<%= f.text_field :email, class: "form-control", placeholder: "Enter Email" %>
<br>
<%= f.submit "Alert Me", class: "btn btn-primary btn-lg btn-block" %>
<% end %>
post 'landing/soon' => 'landing#save_email'
get 'landing/soon' => 'landing#soon'
get 'main/home'
class Coming < ActiveRecord::Base
attr_accessible :email
end
Started POST "/landing/soon" for 127.0.0.1 at 2014-08-20 05:23:11 +0800
Started POST "/landing/soon" for 127.0.0.1 at 2014-08-20 05:23:11 +0800
Processing by LandingController#save_email as HTML
Processing by LandingController#save_email as HTML
Parameters: {"utf8"=>"√", "authenticity_token"=>"8AvNiGAh7TBZB3MNan4c
Qr8RiYtUOlOiKw=", "coming"=>{"email"=>"obedosei@gmail.com"}, "commit"=>
"}
Parameters: {"utf8"=>"√", "authenticity_token"=>"8AvNiGAh7TBZB3MNan4c
Qr8RiYtUOlOiKw=", "coming"=>{"email"=>"obedosei@gmail.com"}, "commit"=>
"}
class StudentsController < ApplicationController
def new
@student = Student.new
end
def create
@student = Student.new(student_params)
if @student.save
session[:user_id] = @user.id
redirect_to student_path, notice: "Student saved successfully"
require 'adwords_api'
class TargetingController < ApplicationController
respond_to :json
def show(keyword_text)
adwords = AdwordsApi::Api.new
require 'adwords_api'
class ApplicationController < ActionController::Base
before_filter :authenticate
protect_from_forgery
private
# Returns the API version in use.