Use Ubuntu 20+ (any LTS version). Recommended hardware for production: 4CPU/ RAM 8Gb / SSD 80Gb
For staging could less power.
If you need, prepare Bucket S3/Spaces and RDS database droplet/instance.
// stimulus controller | |
export default class extends Controller { | |
static targets = ["roleDescription", "roleDescriptionNone", "selectBox"] | |
connect() { | |
// actualizar role list si select tiene algo definido | |
this.updateRolesList() | |
} | |
updateRolesList() { |
# Run rake task from migration file | |
class CreateUsers < ActiveRecord::Migration [7.0] | |
def change | |
create_table :users do It| t.string :first_name t.string :last_name | |
t. string email, index: { unique: true } | |
# other columns | |
t. timestamps | |
end | |
# in posts/index.html.slim | |
= form_for posts_path, method: :get, html: { data: { turbo_frame: 'posts', turbo _action: 'advance' } } do | |
= search field tag :g, params[:q], placeholder: 'Search.. | |
= turbo frame tag 'posts' do | |
= render partial: 'posts/post', collection: @posts | |
= pagy _nav (@pagy) | |
# It will dynamically update the re attribute on the turbo-frame. | |
# So the content will be reloaded in AJAX for every search. |
Armar una aplicación Rails que pueda cumplir siguiente: | |
===== Base: | |
1. Ruby 3.0.1 | |
2. Rails (6.1.4) | |
3. Para Front podes usar Importmaps, TWBS, SimpleForms, etc. | |
4. Foco en Backend | |
5. Frontend no hace falta pulir 100% (con que pueda hacer un submit y procesar formulario - OK) | |
6. Donde se aplica podes utilizar Scaffold |
# frozen_string_literal: true | |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
before_action :configure_permitted_parameters, if: :devise_controller? | |
before_action :authenticate_user! | |
def after_sign_in_path_for(resource) |
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"window.zoomLevel": 0, | |
"editor.fontSize": 14, | |
"files.autoSave": "afterDelay", | |
"editor.tabSize": 2, | |
"editor.rulers": [120], | |
"editor.wordWrapColumn": 120, | |
"editor.wordWrap": "on", |
Ruby < 2.5 fails to install on macOS Big Sur with rbenv because xCode 12 removes outdated packages and it's impossible to rollback to xCode 11.5 and Commandline Tools older version than actual. There are few steps to fix this.
brew install rbenv/tap/openssl@1.0
# view more details at https://stackoverflow.com/questions/59337838/openssl-1-0-2m-on-macos
# VIEW where we have a link to fire modal. F.e., index.html.haml | |
# ... | |
= link_to "Edit form from modal", "#", title: "Title for modal window", data: { toggle: "modal", "load-url": edit_item(item), target: "#modalEditItem" }, class: "btn btn-sm btn-default" | |
# In the same view or corresponding JS asset | |
= content_for :scripts do | |
:javascript | |
$(document).ready(function(){ | |
$('#modalEditItem').on('show.bs.modal', function (e) { | |
// load form (or other content) from remote url |
= f.input :got_franch, label: false, as: :select, required: true, input_html: {class: "js-select2 selector default-input-contact b-gray f-13", data: {placeholder: ("")}} | |
= f.input :got_franch, as: :select, | |
collection: [ ['Si', true], ['No', false] ], | |
label: false, | |
required: false | |
input_html: { | |
class: "js-select2 selector default-input-contact b-gray f-13" | |
} |