# GET /arcs
# GET /arcs.xml
def index
- @search = Arc::Search.new(params[:search])
- @arcs = Arc.paginate(@search.find_options.merge(:page => params[:page], :order => 'location_id, code', :include => :location))
+ @search = Record::Arc::Search.new(params[:search])
+ @arcs = Record::Arc.paginate(@search.find_options.merge(:page => params[:page], :order => 'location_id, code', :include => :location))
respond_to do |format|
format.html # index.html.erb
# GET /arcs/1
# GET /arcs/1.xml
def show
- @arc = Arc.find(params[:id])
+ @arc = Record::Arc.find(params[:id])
respond_to do |format|
format.html # show.html.erb
# GET /arcs/new
# GET /arcs/new.xml
def new
- @arc = Arc.new
+ @arc = Record::Arc.new
respond_to do |format|
format.html # new.html.erb
# GET /arcs/1/edit
def edit
- @arc = Arc.find(params[:id])
+ @arc = Record::Arc.find(params[:id])
end
# POST /arcs
# POST /arcs.xml
def create
- @arc = Arc.new(params[:arc])
+ @arc = Record::Arc.new(params[:arc])
respond_to do |format|
if @arc.save
- flash[:notice] = 'Arc was successfully created.'
+ flash[:notice] = 'Record::Arc was successfully created.'
format.html { redirect_to(@arc) }
format.xml { render :xml => @arc, :status => :created, :location => @arc }
else
# PUT /arcs/1
# PUT /arcs/1.xml
def update
- @arc = Arc.find(params[:id])
+ @arc = Record::Arc.find(params[:id])
respond_to do |format|
if @arc.update_attributes(params[:arc])
- flash[:notice] = 'Arc was successfully updated.'
+ flash[:notice] = 'Record::Arc was successfully updated.'
format.html { redirect_to(@arc) }
format.xml { head :ok }
else
# DELETE /arcs/1
# DELETE /arcs/1.xml
def destroy
- @arc = Arc.find(params[:id])
+ @arc = Record::Arc.find(params[:id])
@arc.destroy
respond_to do |format|
@search = Welcome::Search.new(params[:search])
if @search.text.blank?
time = 3.day.ago
- @arcs = Arc.paginate(:conditions => ["arcs.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :include => :location)
+ @arcs = Record::Arc.paginate(:conditions => ["arcs.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :include => :location)
@pmds = Pmd.paginate(:conditions => ["pmds.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
@vmds = Vmd.paginate(:conditions => ["vmds.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
@xes = X.paginate(:conditions => ["xes.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
- @thumbs = Thumb.paginate(:conditions => ["updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15)
+ @thumbs = Record::Thumb.paginate(:conditions => ["updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15)
else
- @arc_search = Arc::Search.new(params[:search])
- @arcs = Arc.paginate(@arc_search.find_options.merge(:page => nil, :order => 'location_id, code', :per_page => 15, :include => :location))
+ @arc_search = Record::Arc::Search.new(params[:search])
+ @arcs = Record::Arc.paginate(@arc_search.find_options.merge(:page => nil, :order => 'location_id, code', :per_page => 15, :include => :location))
@pmd_search = Pmd::Search.new(params[:search])
@pmds = Pmd.paginate(@pmd_search.find_options.merge(:page => nil, :per_page => 15, :include => { :arc => :location }))
@vmd_search = Vmd::Search.new(params[:search])
class ArcThumb < ActiveRecord::Base
- belongs_to :arc
+ belongs_to :arc, :class_name => 'Record::Arc'
belongs_to :thumb, :class_name => 'Record::Thumb'
end
class Pmd < ActiveRecord::Base
- belongs_to :arc
+ belongs_to :arc, :class_name => 'Record::Arc'
class Search
attr_accessor :path
-class Arc < ActiveRecord::Base
+class Record::Arc < ActiveRecord::Base
belongs_to :location, :class_name => 'Record::Location'
has_many :pmds
has_many :vmds
class Vmd < ActiveRecord::Base
- belongs_to :arc
+ belongs_to :arc, :class_name => 'Record::Arc'
class Search
attr_accessor :path
class X < ActiveRecord::Base
- belongs_to :arc
+ belongs_to :arc, :class_name => 'Record::Arc'
class Search
attr_accessor :path
<tbody>
<% for arc in @arcs %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to arc.code, arc %></td>
+ <td><%=link_to arc.code, arc_path(arc) %></td>
<td><%= arc.extname %></td>
<td><%= arc.location.code %></td>
<td><%= arc.locked? ? 'yes' : 'no' %></td>
<tbody>
<% for pmd in @pmds %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%= pmd.arc ? link_to(pmd.arc.code, pmd.arc) : '(none)' %></td>
+ <td><%= pmd.arc ? link_to(pmd.arc.code, arc_path(pmd.arc)) : '(none)' %></td>
<td><%= pmd.path %></td>
</tr>
<% end %>
<tbody>
<% for arc in @thumb.arcs %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to arc.code, arc %></td>
+ <td><%=link_to arc.code, arc_path(arc) %></td>
<td><%= arc.extname %></td>
<td><%= arc.location.code %></td>
<td><%= arc.locked? ? 'yes' : 'no' %></td>
<tbody>
<% for vmd in @vmds %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to vmd.arc.code, vmd.arc %></td>
+ <td><%=link_to vmd.arc.code, arc_path(vmd.arc) %></td>
<td><%= vmd.path %></td>
</tr>
<% end %>
<tbody>
<% for arc in @arcs %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to arc.code, arc %></td>
+ <td><%=link_to arc.code, arc_path(arc) %></td>
<td><%= arc.extname %></td>
<td><%= arc.location.code %></td>
<td><%= arc.locked? ? 'yes' : 'no' %></td>
<tbody>
<% for pmd in @pmds %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to pmd.arc.code, pmd.arc %></td>
+ <td><%=link_to pmd.arc.code, arc_path(pmd.arc) %></td>
<td><%= pmd.arc.extname %></td>
<td><%= pmd.arc.location.code %></td>
<td><%= pmd.path %></td>
<tbody>
<% for vmd in @vmds %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to vmd.arc.code, vmd.arc %></td>
+ <td><%=link_to vmd.arc.code, arc_path(vmd.arc) %></td>
<td><%= vmd.arc.extname %></td>
<td><%= vmd.arc.location.code %></td>
<td><%= vmd.path %></td>
<tbody>
<% for x in @xes %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to x.arc.code, x.arc %></td>
+ <td><%=link_to x.arc.code, arc_path(x.arc) %></td>
<td><%= x.arc.extname %></td>
<td><%= x.arc.location.code %></td>
<td><%= x.path %></td>
<tbody>
<% for thumb in @thumbs %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to thumb.video_id, thumb %></td>
+ <td><%=link_to thumb.video_id, thumb_path(thumb) %></td>
<td><%= thumb.title %></td>
<td><%= truncate(thumb.description) %></td>
</tr>
<tbody>
<% for x in @xes %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=link_to x.arc.code, x.arc %></td>
+ <td><%=link_to x.arc.code, arc_path(x.arc) %></td>
<td><%= x.path %></td>
</tr>
<% end %>