Add requirements, update headers, presence and uniqueness true.

This commit is contained in:
Tyrel Souza 2014-04-08 17:42:43 -04:00
parent ab906fdd00
commit 3410022799
5 changed files with 13 additions and 22 deletions

View File

@ -2,4 +2,8 @@ class Campaign < ActiveRecord::Base
has_many :videolistings has_many :videolistings
accepts_nested_attributes_for :videolistings accepts_nested_attributes_for :videolistings
validates :clientid, presence: true, uniqueness: true validates :clientid, presence: true, uniqueness: true
validates :billingcode, uniqueness: true
validates :listingcode, presence: true, uniqueness: true
validates :advertisername, presence: true
validates :websiteurl, presence: true
end end

View File

@ -1,7 +1,7 @@
class User < ActiveRecord::Base class User < ActiveRecord::Base
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable # :confirmable, :lockable, :timeoutable and :omniauthable
before_save :ensure_authentication_token # before_save :ensure_authentication_token
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable :recoverable, :rememberable, :trackable, :validatable

View File

@ -1,4 +1,6 @@
class Videolisting < ActiveRecord::Base class Videolisting < ActiveRecord::Base
belongs_to :campaign belongs_to :campaign
validates :videocode, presence: true, uniqueness: true validates :videocode, presence: true, uniqueness: true
validates :producttypeid, presence: true
end end

View File

@ -1,19 +1,6 @@
<ul class="nav pull-right"> <% if user_signed_in? %>
<% if user_signed_in? %> <%= link_to "Profile", edit_user_registration_path %>
<li id="fat-menu" class="dropdown"> <%= link_to "Logout", destroy_user_session_path, :method => :delete %>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <% else %>
Account <b class="caret"></b> <%= link_to "Sign in", new_user_session_path %>
</a> <% end %>
<ul class="dropdown-menu">
<li><%= link_to "Profile", edit_user_registration_path %></li>
<li><%= link_to "Settings", '#' %></li>
<li>
<%= link_to "Logout", destroy_user_session_path, :method => :delete %>
</li>
</ul>
</li>
<li> <%= link_to "Logout", destroy_user_session_path, :method => :delete %></li>
<% else %>
<li><%= link_to "Sign in", new_user_session_path %></li>
<% end %>
</ul>

View File

@ -10,8 +10,6 @@
<body class="<%= body_class %>"> <body class="<%= body_class %>">
<%= render 'layouts/header' %> <%= render 'layouts/header' %>
<%= render 'flashes' -%> <%= render 'flashes' -%>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<div class="row"> <div class="row">
<div class="small-12 medium-12 large-12 columns"> <div class="small-12 medium-12 large-12 columns">