This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/application.rb | |
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(*Rails.groups) | |
module Foundations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= form_for [:admins, @admins_product], remote: true do |f| | |
- if @admins_product.errors.any? | |
#error_explanation | |
%h2= "#{pluralize(@admins_product.errors.count, "error")} prohibited this admins_product from being saved:" | |
%ul | |
- @admins_product.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.label :name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= form_for [:admins,@admins_product] do |f| | |
- if @admins_product.errors.any? | |
#error_explanation | |
%h2= "#{pluralize(@admins_product.errors.count, "error")} prohibited this admins_product from being saved:" | |
%ul | |
- @admins_product.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.label :name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admins::ApplicationController < ApplicationController | |
layout 'layouts/admins' | |
before_action :authenticate_admin! | |
# def authenticate_admin! | |
# return render_404 unless current_user.is_admin? | |
# end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%nav.navbar.navbar-default | |
.container | |
/ Brand and toggle get grouped for better mobile display | |
.navbar-header | |
%button.navbar-toggle.collapsed{"aria-expanded" => "false", "data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", :type => "button"} | |
%span.sr-only Toggle navigation | |
%span.icon-bar | |
%span.icon-bar | |
%span.icon-bar | |
%a.navbar-brand{:href => "#"} Brand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::Admin < ActiveRecord::Base | |
attr_accessor :remember_token, :activation_token, :reset_token | |
before_save :downcase_email | |
before_create :create_activation_digest | |
has_many :microposts | |
validates :name, presence: true, length: { maximum: 50 } | |
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i | |
validates :email, presence: true, length: { maximum: 255 }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::AdminController < ApplicationController | |
authorize_resource :class => false | |
layout "admin" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@product) do |f| %> | |
<% if @product.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h2> | |
<ul> | |
<% @product.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.5' | |
# Use mysql as the database for Active Record | |
gem 'mysql2' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. | |
/home/thinb/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150330-23351-di5g3p.rb extconf.rb | |
checking for rb_thread_blocking_region()... no | |
checking for sys/select.h... yes | |
checking for poll.h... yes | |
checking for sys/epoll.h... yes | |
checking for sys/event.h... no | |
checking for port.h... no | |
checking for sys/resource.h... yes |
NewerOlder