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 Stamp < ActiveRecord::Base | |
####途中省略#### | |
if Rails.env.production? | |
S3_CREDENTIALS={access_key_id:ENV['S3_ACCESS_KEY_ID'], secret_access_key:ENV['S3_SECRET_KEY'], bucket:"hoge-bucket"} | |
end | |
if Rails.env.production? | |
has_attached_file :stamp, storage: :s3, s3_credentials: S3_CREDENTIALS, | |
styles: {stamps_s:"100x100>",stamps:"350x350>"},url:":s3_domain_url",path:"stamps/:style/:filename" | |
else | |
has_attached_file :stamp, url: "/:style/:img_dir_num/:filename" , styles: {stamps_s:"100x100>",stamps:"350x350>"} |
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 Stamp < ActiveRecord::Base | |
Paperclip.interpolates :img_dir_num do |attachment, style| | |
(attachment.instance.id * 0.01).to_i | |
end | |
Paperclip.interpolates :filename do |attachment, style| | |
attachment.instance.id.to_s + ".png" | |
end | |
if Rails.env.production? | |
S3_CREDENTIALS = {access_key_id: ENV['S3_ACCESS_KEY_ID'], secret_access_key: ENV['S3_SECRET_KEY'], bucket: "hoge-bucket"} | |
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
localhost: &localnet | |
/admin/user: | |
- 192.168.111.22 | |
development: | |
<<: *localnet | |
test: | |
<<: *localnet | |
production: | |
/admin/point: | |
- 56.2.107.111 |
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
private | |
def update_params | |
params.require(:hoge).permit(:title, :description, :priority, :status) | |
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
one: | |
id: 1 | |
title: 'MyString' | |
stamp_aws_id: 1 | |
usertokenid: 'testaaaa1111' | |
downloadcount: 10 | |
category: 'words' | |
rank_display_flag: 0 | |
stamp_file_name: 'test.jpg' | |
stamp_content_type: 'jpg' |
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
var testCtrl = function($scope) { | |
$scope.users = [ | |
{"name": "nakamura", "point": "10"}, | |
{"name": "hoge", "point": "20"}, | |
{"name": "ugaugo", "point": "200"}, | |
]; | |
} |
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
<!DOCTYPE HTML> | |
<html ng-app> | |
<head> | |
<script src="assets/application.js"></script> | |
<script src="js/testScript.js"></script> | |
</head> | |
<body> | |
<div> | |
<label>Name:</label> | |
<input type="text" ng-model="yourName" placeholder="Enter a name here"> |
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 EventsController < ApplicationController | |
def index | |
@events = Event.all | |
render json: @events | |
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
#coding: utf-8 | |
Event.create(title: '忘年会', description: '会社の忘年会をします') | |
Event.create(title: 'クリスマス会', description: '家族でクリスマス会をします。') | |
Event.create(title: '子供と出かける日', description: '子供を連れて、買い物に行きます') |
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.factory 'Events', ['$resource', ($resource) -> | |
$resource '/events/index' | |
] |
OlderNewer