View docker-compose.yml
This file contains 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
version: '2' | |
services: | |
postgres: | |
image: 'postgres:latest' | |
restart: always | |
volumes: | |
- './postgres_data:/var/lib/postgresql/data' | |
environment: | |
- POSTGRES_PASSWORD=secure_pass_here | |
ports: |
View static.yml
This file contains 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
name: Static Code Analysis | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
code-analysis: | |
runs-on: ubuntu-latest | |
steps: |
View dusk.yml
This file contains 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
name: Dusk Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
dusk-tests: | |
runs-on: ubuntu-latest | |
services: |
View laravel.yml
This file contains 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
name: Laravel | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
services: |
View application.html.erb
This file contains 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> | |
<head> | |
<title>TestMagicTest</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<%= csrf_meta_tags %> | |
<%= csp_meta_tag %> | |
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> | |
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> |
View Gemfile
This file contains 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
group :test do | |
# Adds support for Capybara system testing and selenium driver | |
gem 'capybara', '>= 3.26' | |
gem 'selenium-webdriver' | |
# Easy installation and use of web drivers to run system tests with browsers | |
gem 'webdrivers' | |
gem 'magic_test' | |
end |
View styles_controller.rb
This file contains 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
def index | |
@styles = Style.all | |
@style = Style.new | |
end | |
def create | |
@style = Style.new(style_params) | |
respond_to do |format| | |
if @style.save |
View index.html.rb
This file contains 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
<p id="notice"><%= notice %></p> | |
<h1>Styles</h1> | |
<%= turbo_stream_from "styles" %> | |
<%= render "styles/form", style: @style %> | |
<%= turbo_frame_tag "styles" do %> | |
<%= render @styles %> | |
<%end%> | |
<%= link_to 'New Style', new_style_path %> |
View styles_controller.rb
This file contains 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
def update | |
respond_to do |format| | |
if @style.update(style_params) | |
format.html { redirect_to styles_url, notice: "Style was successfully updated." } # Cambió el redirect_to | |
format.json { render :show, status: :ok, location: @style } | |
else | |
#Agrego esta linea | |
format.turbo_stream { render turbo_stream: turbo_stream.replace(@style, partial: "styles/form", locals: { style: @style}) } | |
format.html { render :edit, status: :unprocessable_entity } | |
format.json { render json: @style.errors, status: :unprocessable_entity } |
View edit.html.rb
This file contains 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
<h1>Editing Style</h1> | |
<%= turbo_frame_tag dom_id(@style) do %> | |
<%= render 'form', style: @style %> | |
<%= link_to 'Cancel', styles_url %> | |
<% end %> |
NewerOlder