app/controllers/admin/galleries_controller.rb
# Search a picture by random in gallery
# and return it
Search a picture by random in gallery
and return it
Search a picture by random in gallery and return it
def random_front_picture
    if request.xhr?
      @gallery = Gallery.find_by_permalink params[:id]
    else
      edit
    end
    @gallery.random_front_picture
    respond_to do |format|
      format.html {render :action => 'edit'}
      format.js {}
    end
  end
def random_front_picture if request . xhr? @gallery = Gallery . find_by_permalink params [ :id ] else edit end @gallery . random_front_picture respond_to do | format | format . html { render :action => 'edit' } format . js { } end end
Search a picture by random in gallery
and return it
Search a picture by random in gallery and return it