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
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
before_action :configure_permitted_parameters, if :devise_controller? | |
protected | |
def configure_permitted_parameters | |
devise_parameter_sanitizer.permit(:sign_up, keys: [:username, :email, :password, :password_confirmation, :remember_me]) | |
devise_parameter_sanitizer.permit(:sign_in, keys: [:username, :email, :password, :password_confirmation, :remember_me]) |
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
Rails.application.routes.draw do | |
devise_for :users | |
get 'pages/about' | |
# The priority is based upon order of creation: first created -> highest priority. | |
# See how all your routes lay out with "rake routes". | |
# You can have the root of your site routed with "root" | |
# root 'welcome#index' |
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
Rails.application.routes.draw do | |
devise_for :users | |
get 'pages/about' | |
# The priority is based upon order of creation: first created -> highest priority. | |
# See how all your routes lay out with "rake routes". | |
# You can have the root of your site routed with "root" | |
# root 'welcome#index' |
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
ActiveAdmin.register Project do | |
permit_params :name, :content, :price, :image | |
show do |t| | |
attributes_table do | |
row :name | |
row :content | |
row :price | |
row :image do | |
project.image? ? image_tag(project.image, height: '100') : content_tag(:span, "No photo yet") |
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
ActiveAdmin.register User do | |
permit_params :email, :name, :paid, :user_id | |
show do |t| | |
attributes_table do | |
row :email, label: "Почта" | |
row :name, label: "Имя" | |
row :paid, label: "Статус оплаты" | |
end |
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
#Вот модель task.rb | |
class Task < ActiveRecord::Base | |
extend FriendlyId | |
friendly_id :title, use: [:slugged, :finders] | |
has_many :taskstatus | |
has_many :users, through: :taskstatus | |
#Вот модель user.rb | |
class User < ActiveRecord::Base |
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
class CreateTaskstatuses < ActiveRecord::Migration | |
def change | |
create_table :taskstatuses do |t| | |
t.reference :user | |
t.reference :task | |
t.string :task_status | |
t.timestamps null: false | |
end |
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
<div class="card-action grey-text text-darken-4"> | |
<form action="#"> | |
<div class="file-field input-field"> | |
<div class="btn"> | |
<span>Сдать отчет</span> | |
<input type="file" multiple> | |
</div> | |
<div class="file-path-wrapper"> | |
<%= form_tag.file_field :reports, :class=>"file-path validate", :placeholder => "Загрузите один или более файлов", multiple: true %> | |
</div> |
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
class Users::RegistrationsController < Devise::RegistrationsController | |
# before_action :configure_sign_up_params, only: [:create] | |
# before_action :configure_account_update_params, only: [:update] | |
# GET /resource/sign_up | |
# def new | |
# super | |
# end | |
# POST /resource |
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
<% if @reviews.blank? %> | |
<span class="center"><h4>У этого курса пока нет отзывов</h4></span> | |
<% end %> | |
<% @reviews.order("id desc").each do |r| %> | |
<hr> | |
<div class="row"> | |
<div class="col m1"> | |
<%= image_tag avatar_url(r.user), class: "circle responsive-img avatar-small" %> |
OlderNewer