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
# This file is auto-generated from the current state of the database. Instead | |
# of editing this file, please use the migrations feature of Active Record to | |
# incrementally modify your database, and then regenerate this schema definition. | |
# | |
# Note that this schema.rb definition is the authoritative source for your | |
# database schema. If you need to create the application database on another | |
# system, you should be using db:schema:load, not running all the migrations | |
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |
# you'll amass, the slower it'll run and the greater likelihood for issues). | |
# |
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
c:\Site\brokerv1\brokr>rails console | |
Loading development environment (Rails 5.0.0) | |
irb(main):001:0> Classified.all | |
Classified Load (2.0ms) SELECT "classifieds".* FROM "classifieds" | |
=> #<ActiveRecord::Relation | |
[#<Classified id: 21, created_at: "2016-07-26 08:37:06", updated_at: "2016-07-26 08:37:06", make: nil, model: nil, year: nil, color: nil, title: nil, condition: nil, price: nil, offer: nil, make_country: nil, category: nil, description: nil, user_id: 4>, | |
#<Classified id:22, created_at: "2016-07-26 08:38:59", updated_at: "2016-07-26 08:38:59", make: nil, model: nil, year: nil, color: nil, title: nil, condition: nil, price: nil, offer: nil, make_country: nil, category: nil, description: nil, user_id: 4>, | |
#<Classified id: 23, created_at: "2016-07-26 08:43:30", updated_at: "2016-07-26 08:43:30", make: nil, model: nil, year: nil, color: nil, title: nil, condition: nil, price: nil, offer: nil, make_country: nil, category: nil, description: nil, user_id: 4>, | |
#<Classified id: 24, created_at: "2016-07-26 0 |
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="new"> | |
<div class="container-fluid"> | |
<section class="container"> | |
<div class="container-page"> | |
<div class="col-md-6"> | |
<h3 class="dark-grey">Εξοπλισμός προς πώληση</h3> | |
<%= form_for (@classified) do |f| %> | |
<div class="form-group col-lg-3"> |
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="new"> | |
<div class="container-fluid"> | |
<section class="container"> | |
<div class="container-page"> | |
<%= @user.classifieds.each do |c| %> | |
<%= link_to classified_path(c) do %> | |
<ul> | |
<li><%= c.title %></li> | |
<li><%= c.created_at %> </li> | |
</ul> |
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 Classified < ApplicationRecord | |
belongs_to :user | |
has_many :photos | |
accepts_nested_attributes_for :photos | |
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
<%=form_for categories_path do |f| %> | |
<%= f.select :parent_id, nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" } %> | |
<%= select_tag 'parent_id', options_for_select(nested_set_options(Category) {|i| "#{'-' * i.level} #{i.name}" } ) %> | |
<%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
<% nested_set_options(Category, @category).each do |f| %> | |
<%= link_to f%> | |
<%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
irb(main):015:0> accessorychild3 = Category.create!(:name=> "Cables") | |
(0.1ms) begin transaction | |
Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY "categories"."rgt" desc LIMIT ? [["LIMIT", 1]] | |
Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT ? [["id", 141], ["LIMIT", 1]] | |
SQL (0.3ms) INSERT INTO "categories" ("name", "lft", "rgt") VALUES (?, ?, ?) [["name", "Cables"], ["lft", 33], ["rgt", 34]] | |
Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT ? [["id", 143], ["LIMIT", 1]] | |
SQL (0.3ms) UPDATE "categories" SET "depth" = 0 WHERE "categories"."id" IN (SELECT "categories"."id" FROM "categories" WHERE "categories"."id" = 143 ORDER BY "categories"."lft") | |
(10.6ms) commit transaction | |
irb(main):021:0* accessorychild3.move_to_child_of(128) |
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
Routing Error | |
uninitialized constant PhotosController | |
Rails.root: /home/frcake/workspace/Site/brokerv1/brokr | |
Application Trace | Framework Trace | Full Trace | |
Routes | |
Routes match in priority from top to bottom |
OlderNewer