This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module V1 | |
class Users < Base | |
resource :users do | |
desc 'Lookup of single user' | |
get 'martin' do | |
'hello' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe V1::Users do | |
describe 'GET /api/v1/users' do | |
it 'returns array of users' do | |
3.times { Fabricate :user } | |
get '/api/v1/users', {}, https_and_authorization | |
response.status.should eq 200 | |
expected_ids = User.all.page(1).map { |a| a.id.to_s } | |
expected_ids.each { |id| response.body.should match id } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class API < Grape::API | |
prefix 'api' | |
format :json | |
default_format :json | |
mount ::V1::Base | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module V1 | |
class Base < API | |
puts "in Base" | |
version 'v1', using: :path, vendor: 'orwapp', cascade: false | |
mount Users | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExcelController < ApplicationController | |
layout :resolve_layout | |
def dagsrapport | |
project = Project.find(params[:project_id]) | |
profession = Profession.find(params[:profession_id]) | |
overtime = params[:overtime] | |
file_name = Dagsrapport.new(project: project, profession: profession, | |
overtime: overtime).create_spreadsheet | |
respond_to do |format| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- content_for :breadcrumb do | |
= link_to 'Mine prosjekter', projects_path | |
| > | |
= @department.title | |
table | |
thead | |
th | |
th Kunde |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app', []) | |
.directive('starred', function() { | |
return { | |
restrict: 'E', | |
scope: { | |
objectClass: '=' | |
}, | |
templateUrl: '/templates/starred.html.slim', | |
controller: function($scope, $attrs) { | |
return $scope.star_clicked = function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TemplatesController < ApplicationController | |
skip_before_filter :authenticate_user! | |
#skip_authorization_check :template | |
def template | |
render :template => 'templates/' + params[:path], :layout => false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = angular.module("trenger") | |
app.controller 'SessionCtrl', ['$scope', '$http', '$window', '$localStorage', '$q', | |
($scope, $http, $window, $localStorage, $q) -> | |
$scope.current_user = JSON.parse($("meta[name='current_user']").attr('content')) | |
$scope.authErrors = [] | |
defer = $q.defer() | |
$scope.token = $localStorage.token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = angular.module("trenger") | |
app.controller 'SessionCtrl', ['$scope', '$http', '$window', '$localStorage', '$q', | |
($scope, $http, $window, $localStorage, $q) -> | |
$scope.current_user = JSON.parse($("meta[name='current_user']").attr('content')) | |
$scope.authErrors = [] | |
defer = $q.defer() | |
$scope.authorized = () -> | |
$scope.current_user? and $scope.current_user._id? |