Revision 4, 0.8 kB
(checked in by falcon, 17 years ago)
|
75% complete. ajax support for engineering and galleries. galleries add/edit. artwork and engineering layouts.
|
Line | |
---|
1 | class EngineeringController < ApplicationController |
---|
2 | layout "main" |
---|
3 | |
---|
4 | def index |
---|
5 | populate_sidebar("Engineering") |
---|
6 | |
---|
7 | respond_to do |format| |
---|
8 | format.html # index.html.erb |
---|
9 | format.xml { render :xml => @models } |
---|
10 | end |
---|
11 | end |
---|
12 | |
---|
13 | def show_media |
---|
14 | respond_to do |format| |
---|
15 | format.js{ |
---|
16 | @gallery = Gallery.find(params[:id]) |
---|
17 | render :update do |page| |
---|
18 | page.replace_html "Gallery_Media_" + params[:id].to_s, :partial => "show_media" |
---|
19 | page.visual_effect :slide_down, "Gallery_Media_" + params[:id].to_s |
---|
20 | end |
---|
21 | } |
---|
22 | end |
---|
23 | end |
---|
24 | |
---|
25 | def hide_media |
---|
26 | respond_to do |format| |
---|
27 | format.js{ |
---|
28 | @gallery = Gallery.find(params[:id]) |
---|
29 | render :update do |page| |
---|
30 | page.replace_html "Gallery_Media_" + params[:id].to_s, :partial => "show_media" |
---|
31 | page.visual_effect :slide_down, "Gallery_Media_" + params[:id].to_s |
---|
32 | end |
---|
33 | } |
---|
34 | end |
---|
35 | end |
---|
36 | end |
---|