###クロスドメイン
異なるドメイン間でAjax通信するとデータが取得できない。
オリジン間リソース共有(CORS Cross-Origin Resource Sharing)
https://developer.mozilla.org/ja/docs/Web/HTTP/HTTP_access_control
http://nginx.org/en/docs/beginners_guide.html#conf_structure
- nginxでhtmlを動かす
package main | |
import ( | |
"context" | |
"log" | |
"github.com/aws/aws-sdk-go-v2/aws" | |
"github.com/aws/aws-sdk-go-v2/config" | |
"github.com/aws/aws-sdk-go-v2/service/s3" | |
) |
$(document).on 'click', 'input[type=submit]', -> | |
console.log("Hello") | |
if $('input[type=text]').val() == '' | |
return false | |
$(document).on 'ajax:success', (e) -> | |
console.log('ajax') | |
$('#user_first_name').val('') | |
console.log(e.detail[0]) |
mkdir XXXX_app | |
cd XXXX_app | |
rbenv exec bundle init | |
vim Gemfile | |
bundle install --path vendor/bundle |
# セッションを参照したいとき | |
session['user_id'] | |
# クッキーを参照したいとき | |
@response.cookies['remember_token'] | |
@request.cookies['user_id'] |
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "myapp/storage/logs/lumen.log" could not be opened: failed to open stream: Permission denied |
###クロスドメイン
異なるドメイン間でAjax通信するとデータが取得できない。
オリジン間リソース共有(CORS Cross-Origin Resource Sharing)
https://developer.mozilla.org/ja/docs/Web/HTTP/HTTP_access_control
http://nginx.org/en/docs/beginners_guide.html#conf_structure
Installing nokogiri 1.8.2 with native extensions | |
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. | |
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.2/ext/nokogiri | |
/usr/bin/ruby2.5 -r ./siteconf20180609-8585-1wf897h.rb extconf.rb | |
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h | |
extconf failed, exit code 1 | |
Gem files will remain installed in /var/lib/gems/2.5.0/gems/nokogiri-1.8.2 for inspection. |
turbolink関連?
対応を考える
https://qiita.com/saboyutaka/items/bb089e8208239bf6fdc0
document.addEventListener("turbolinks:load", function(){
# controller | |
before_action :correct_user | |
before_action :exist_todo | |
# タスクリストが存在しているか(ユーザーのタスクリストか)確認 | |
def exists_tasklist | |
@tasklists = cuurent_user.tasklist.find_by(id: params[:task_list_id]) | |
redirect_to user_path, '存在しません。' if @tasklist_title.nil? | |
end |
def correct_user | |
@tasklist = cuurent_user.tasklist.find_by(params[:task_list_id]) | |
redirect_to user_path unless @tasklist.nil? | |
end |