change form around. fix styles to fit bootstrap.

This commit is contained in:
Tyrel Souza 2014-04-09 17:39:48 -04:00
parent defa655392
commit dedc9b782e
4 changed files with 63 additions and 49 deletions

View File

@ -4,7 +4,6 @@ $medgray: #666;
.videolisting {
label {
color: #fff;
float: left;
}
input {border: 2px inset;}

View File

@ -20,13 +20,14 @@ class CampaignsController < ApplicationController
def edit
end
def create
@campaign = Campaign.new campaign_params
if @campaign.save
respond_to do |format|
format.json { render json: @campaign }
format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }
format.html { redirect_to campaign_path(@campaign.clientid), notice: 'Campaign was successfully created.' }
end
else
render action: 'new'

View File

@ -1,4 +1,8 @@
<%= simple_form_for(@campaign, html: {class: 'form-horizontal'}) do |frm| %>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
<% if @campaign.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@campaign.errors.count, "error") %> prohibited this campaign from being saved:</h2>
@ -9,8 +13,14 @@
</ul>
</div>
<% end %>
</div>
<div class="col-md-1"></div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-5">
<%= frm.input :clientid, label: 'Client ID' %>
<%= frm.input :listingcode, label: 'Listing Code' %>
<%= frm.input :websiteurl, label: 'Website URL'%>
@ -29,8 +39,9 @@
<%= frm.input :city, label: 'City' %>
<%= frm.input :state, label: 'State' %>
<%= frm.input :zip, label: 'ZIP' %>
</div>
<div class="col-md-5">
<div class="videolisting">
<%= frm.simple_fields_for(:videolistings, html: {class: 'form-horizontal'}) do |vidlist| %>
<div class="<%= cycle('odd','even') %>">
@ -47,7 +58,10 @@
</div>
<% end %>
</div>
</div>
<div class="col-md-1"></div>
</div>
<div class="actions">

View File

@ -1,5 +1,5 @@
<h1>Listing campaigns</h1>
<table>
<table class="table table-striped">
<thead>
<tr>
<th>Clientid</th>