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
/* eslint no-console:0 */ | |
// This file is automatically compiled by Webpack, along with any other files | |
// present in this directory. You're encouraged to place your actual application logic in | |
// a relevant structure within app/javascript and only use these pack files to reference | |
// that code so it'll be compiled. | |
// | |
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate | |
// layout file, like app/views/layouts/application.html.erb | |
function importAll (r) { | |
r.keys().forEach(r); |
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
<article> | |
<h1>An article about lemons</h1> | |
<img alt="a picture of lemons"> | |
<h3>What are lemons?</h3> | |
<p>Lemons are a yellow fruit [ .... ] </p> | |
<h3>Where do lemons grow?</h3> | |
<p>Lemons grow on lemon trees [ .... ] </p> | |
<img alt="a green lemon"> | |
<h3>Who eats lemons?</h3> | |
<p>Kids love lemons! [ .... ] </p> |
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
upstream puma { | |
server unix:///home/ubuntu/apps/MyApp/shared/tmp/sockets/MyApp-puma.sock; | |
} | |
server { | |
listen 80 default_server deferred; | |
if ($http_user_agent ~* (banned|banned1|banned2)) { | |
return 403; | |
} |
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 'rails_helper' | |
RSpec.describe RegistrationController do | |
include Devise::Test::ControllerHelpers | |
describe 'POST /users for user' do | |
let(:user) { | |
{ | |
email: "[email protected]", | |
password: "master-tester", |
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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
require 'spec_helper' | |
ENV['RAILS_ENV'] = 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
# Prevent database truncation if the environment is production | |
abort("The Rails environment is running in production mode!") if Rails.env.production? | |
require 'rspec/rails' | |
require 'devise' | |
# Add additional requires below this line. Rails is not loaded until this point! |
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
declare var $: any; | |
declare var application: Application; | |
class ApplicationModule { | |
} | |
class modalHandling extends ApplicationModule { | |
public get(action: string) { | |
application.html.get(`/modals/${ action }`, function(data: string) { | |
let container = this.getContainer(); |
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 Rateable | |
def self.included(base) | |
base.class_eval do | |
attribute :average_rating | |
attribute :ratings_total | |
has_many :all_ratings, foreign_key: "#{self.class.name}_id", class_name: 'Rating' # class_name should be the included class name but returns 'Class'instead | |
has_many :published_ratings, -> { where(:status => Rating::STATUSES[:PUBLISHED])}, foreign_key: "#{self.class.name}_id", class_name: "Rating" | |
end | |
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
# THIS IS TOTALLY RENEWED - BE CAREFUL | |
angular.module('pazienti_light').controller "LoginCtrl", ['$scope', 'current_session', 'Session', 'MultiForm', | |
($scope, current_session, Session, MultiForm)-> | |
$scope.MultiForm = MultiForm | |
# INITIALIZING PROFILE |
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
# | |
# Here we manage the action of creating a new question. | |
# | |
angular.module('mymodule_light').controller "QuestionsNewCtrl", ['$scope', '$modal', '$http', 'current_session', ($scope, $modal, $http, current_session)-> | |
$scope.question = | |
description: "" | |
$scope.ask = (question)-> |
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
# | |
# Here we manage the action of creating a new question. | |
# | |
angular.module('pazienti_light').controller "QuestionsNewCtrl", ['$scope', '$modal', '$http', 'current_session', ($scope, $modal, $http, current_session)-> | |
$scope.question = | |
description: "" | |
$scope.ask = (question)-> |