phcdevworks_real_estate 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +0 -0
- data/Rakefile +32 -0
- data/app/assets/config/phcdevworks_real_estate_manifest.js +2 -0
- data/app/assets/javascripts/phcdevworks_real_estate/application.js +2 -0
- data/app/assets/stylesheets/phcdevworks_real_estate/application.scss +2 -0
- data/app/assets/stylesheets/phcdevworks_real_estate/property/features.css +4 -0
- data/app/assets/stylesheets/phcdevworks_real_estate/property/listings.css +4 -0
- data/app/controllers/phcdevworks_real_estate/application_controller.rb +13 -0
- data/app/controllers/phcdevworks_real_estate/property/features_controller.rb +80 -0
- data/app/controllers/phcdevworks_real_estate/property/listings_controller.rb +80 -0
- data/app/helpers/phcdevworks_real_estate/application_helper.rb +4 -0
- data/app/helpers/phcdevworks_real_estate/property/features_helper.rb +4 -0
- data/app/helpers/phcdevworks_real_estate/property/listings_helper.rb +4 -0
- data/app/jobs/phcdevworks_real_estate/application_job.rb +4 -0
- data/app/mailers/phcdevworks_real_estate/application_mailer.rb +6 -0
- data/app/models/phcdevworks_real_estate/application_record.rb +5 -0
- data/app/models/phcdevworks_real_estate/property.rb +7 -0
- data/app/models/phcdevworks_real_estate/property/feature.rb +12 -0
- data/app/models/phcdevworks_real_estate/property/listing.rb +25 -0
- data/app/views/layouts/phcdevworks_real_estate/application.html.erb +94 -0
- data/app/views/layouts/phcdevworks_real_estate/components/backend/footer/_footer.html.erb +16 -0
- data/app/views/layouts/phcdevworks_real_estate/components/backend/navigation/_top_menu.html.erb +37 -0
- data/app/views/layouts/phcdevworks_real_estate/components/backend/sidebars/_side_menu.html.erb +213 -0
- data/app/views/phcdevworks_real_estate/property/features/_form.html.erb +18 -0
- data/app/views/phcdevworks_real_estate/property/features/edit.html.erb +37 -0
- data/app/views/phcdevworks_real_estate/property/features/index.html.erb +62 -0
- data/app/views/phcdevworks_real_estate/property/features/new.html.erb +37 -0
- data/app/views/phcdevworks_real_estate/property/features/show.html.erb +64 -0
- data/app/views/phcdevworks_real_estate/property/listings/_form.html.erb +96 -0
- data/app/views/phcdevworks_real_estate/property/listings/edit.html.erb +37 -0
- data/app/views/phcdevworks_real_estate/property/listings/index.html.erb +70 -0
- data/app/views/phcdevworks_real_estate/property/listings/new.html.erb +37 -0
- data/app/views/phcdevworks_real_estate/property/listings/show.html.erb +50 -0
- data/config/initializers/friendly_id.rb +107 -0
- data/config/routes.rb +18 -0
- data/db/migrate/20180918034641_create_join_table_features_listings.rb +8 -0
- data/db/migrate/20190824010811_create_phcdevworks_real_estate_property_listings.rb +34 -0
- data/db/migrate/20190824011000_create_phcdevworks_real_estate_property_features.rb +15 -0
- data/lib/phcdevworks_real_estate.rb +5 -0
- data/lib/phcdevworks_real_estate/engine.rb +33 -0
- data/lib/phcdevworks_real_estate/version.rb +3 -0
- data/lib/tasks/phcdevworks_real_estate_tasks.rake +4 -0
- metadata +302 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
<!-- PHCRealListings(Pro) Form - Property Listings -->
|
2
|
+
<%= form_with(model: property_listing, local: true, html: {class: "add-listing-form"}) do |phc_pro_property_listing| %>
|
3
|
+
|
4
|
+
<!-- PHCNotifi Render Validation -->
|
5
|
+
<%= render 'phcdevworks_notifications/bootstrap/validations', :object => @property_listing %>
|
6
|
+
<!-- PHCNotifi Render Validation -->
|
7
|
+
|
8
|
+
<div class="form-group">
|
9
|
+
<%= phc_pro_property_listing.label :listing_title %>
|
10
|
+
<%= phc_pro_property_listing.text_field :listing_title, class: "form-control" %>
|
11
|
+
</div>
|
12
|
+
<div class="form-group">
|
13
|
+
<%= phc_pro_property_listing.label :listing_description %>
|
14
|
+
<%= phc_pro_property_listing.text_field :listing_description, class: "form-control" %>
|
15
|
+
</div>
|
16
|
+
<div class="form-group">
|
17
|
+
<%= phc_pro_property_listing.label :listing_street_address %>
|
18
|
+
<%= phc_pro_property_listing.text_field :listing_street_address, class: "form-control", id: "phc-gmaps-input-address" %>
|
19
|
+
</div>
|
20
|
+
<div class="form-group">
|
21
|
+
<%= phc_pro_property_listing.label :listing_price %>
|
22
|
+
<%= phc_pro_property_listing.text_field :listing_price, class: "form-control" %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<hr>
|
26
|
+
|
27
|
+
<div class="form-group">
|
28
|
+
<%= phc_pro_property_listing.label :listing_area %>
|
29
|
+
<%= phc_pro_property_listing.text_field :listing_area, class: "form-control" %>
|
30
|
+
</div>
|
31
|
+
<div class="form-group">
|
32
|
+
<%= phc_pro_property_listing.label :listing_property_area %>
|
33
|
+
<%= phc_pro_property_listing.text_field :listing_property_area, class: "form-control" %>
|
34
|
+
</div>
|
35
|
+
<div class="form-group">
|
36
|
+
<%= phc_pro_property_listing.label :listing_garage_area %>
|
37
|
+
<%= phc_pro_property_listing.text_field :listing_garage_area, class: "form-control" %>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<hr>
|
41
|
+
|
42
|
+
<div class="form-group">
|
43
|
+
<%= phc_pro_property_listing.label :listing_room %>
|
44
|
+
<%= phc_pro_property_listing.select(:listing_room, ['1','2','3','4','5','6','7+'], {}, { :class => 'form-control' }) %>
|
45
|
+
</div>
|
46
|
+
<div class="form-group">
|
47
|
+
<%= phc_pro_property_listing.label :listing_bed %>
|
48
|
+
<%= phc_pro_property_listing.select(:listing_bed, ['1','2','3','4','5','6','7+'], {}, { :class => 'form-control' }) %>
|
49
|
+
</div>
|
50
|
+
<div class="form-group">
|
51
|
+
<%= phc_pro_property_listing.label :listing_bath %>
|
52
|
+
<%= phc_pro_property_listing.select(:listing_bath, ['1','2','3','4+'], {}, { :class => 'form-control' }) %>
|
53
|
+
</div>
|
54
|
+
<div class="form-group">
|
55
|
+
<%= phc_pro_property_listing.label :listing_garage %>
|
56
|
+
<%= phc_pro_property_listing.select(:listing_garage, ['1 Car','2 Cars','3 Cars','4+ Cars'], {}, { :class => 'form-control' }) %>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<hr>
|
60
|
+
|
61
|
+
<div class="form-group">
|
62
|
+
<%= phc_pro_property_listing.label :listing_type %>
|
63
|
+
<%= phc_pro_property_listing.select(:listing_type, ['House','Condominium','Cottage','Land'], {}, { :class => 'form-control' }) %>
|
64
|
+
</div>
|
65
|
+
<div class="form-group">
|
66
|
+
<%= phc_pro_property_listing.label :listing_status %>
|
67
|
+
<%= phc_pro_property_listing.select(:listing_status, ['For Sale','Sold'], {}, { :class => 'form-control' }) %>
|
68
|
+
</div>
|
69
|
+
<div class="form-group">
|
70
|
+
<%= phc_pro_property_listing.label :listing_year_built %>
|
71
|
+
<%= phc_pro_property_listing.select(:listing_year_built, ['1990','2018'], {}, { :class => 'form-control' }) %>
|
72
|
+
</div>
|
73
|
+
<div class="form-group">
|
74
|
+
<%= phc_pro_property_listing.label :listing_energy_class %>
|
75
|
+
<%= phc_pro_property_listing.select(:listing_energy_class, ['A','B'], {}, { :class => 'form-control' }) %>
|
76
|
+
</div>
|
77
|
+
<div class="form-group">
|
78
|
+
<%= phc_pro_property_listing.label :listing_leed_rating %>
|
79
|
+
<%= phc_pro_property_listing.select(:listing_leed_rating, ['Certified','Silver', 'Gold', ''], {}, { :class => 'form-control' }) %>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div class="form-group">
|
83
|
+
<%= phc_pro_property_listing.label :listing_upload %>
|
84
|
+
<%= phc_pro_property_listing.file_field :listing_upload, class: "form-control" %>
|
85
|
+
</div>
|
86
|
+
<div class="form-group">
|
87
|
+
<%= phc_pro_property_listing.label :gallery_upload %>
|
88
|
+
<%= phc_pro_property_listing.file_field :gallery_upload, multiple: true , class: "form-control" %>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="actions">
|
92
|
+
<%= phc_pro_property_listing.submit class: "btn btn-primary" %>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<% end %>
|
96
|
+
<!-- PHCRealListings(Pro) Form - Property Listings -->
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!-- Title System -->
|
2
|
+
<% phc_title "Property Listings" %>
|
3
|
+
<% phc_title_tagline "Edit Property Listing" %>
|
4
|
+
<% phc_breadcrumb_one link_to "Property" %>
|
5
|
+
<% phc_breadcrumb_two link_to "Listings" %>
|
6
|
+
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
+
<!-- Title System -->
|
8
|
+
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
+
</ol>
|
15
|
+
<!-- Page Bradcrumbs -->
|
16
|
+
|
17
|
+
<!-- Page Header -->
|
18
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
+
<!-- Page Header -->
|
20
|
+
|
21
|
+
<!-- Page Content -->
|
22
|
+
<div class="panel panel-inverse">
|
23
|
+
<div class="panel-heading">
|
24
|
+
<div class="panel-heading-btn">
|
25
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
26
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
27
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
28
|
+
</div>
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
30
|
+
</div>
|
31
|
+
<div class="panel-body">
|
32
|
+
<!-- Edit Form Property Listings -->
|
33
|
+
<%= render 'form', property_listing: @property_listing %>
|
34
|
+
<!-- Edit Form Property Listings -->
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<!-- Page Content -->
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<!-- Title System -->
|
2
|
+
<% phc_title "Property Listings" %>
|
3
|
+
<% phc_title_tagline "Property Listings Index" %>
|
4
|
+
<% phc_breadcrumb_one link_to "Property" %>
|
5
|
+
<% phc_breadcrumb_two link_to "Listings" %>
|
6
|
+
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
+
<!-- Title System -->
|
8
|
+
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
+
</ol>
|
15
|
+
<!-- Page Bradcrumbs -->
|
16
|
+
|
17
|
+
<!-- Page Header -->
|
18
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
+
<!-- Page Header -->
|
20
|
+
|
21
|
+
<!-- Page Content -->
|
22
|
+
<div class="panel panel-inverse">
|
23
|
+
<div class="panel-heading">
|
24
|
+
<div class="panel-heading-btn">
|
25
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
26
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
27
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
28
|
+
</div>
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
30
|
+
</div>
|
31
|
+
<div class="panel-body">
|
32
|
+
<!-- Table - Property Index -->
|
33
|
+
<div class="table-responsive">
|
34
|
+
<table class="table table-striped table-bordered">
|
35
|
+
<thead>
|
36
|
+
<tr>
|
37
|
+
<th>Listing Title</th>
|
38
|
+
<th>Listing Price</th>
|
39
|
+
<th>Year Built</th>
|
40
|
+
<th>Listing Type</th>
|
41
|
+
<th>Listing Status</th>
|
42
|
+
<th></th>
|
43
|
+
</tr>
|
44
|
+
</thead>
|
45
|
+
<tbody>
|
46
|
+
<% @property_listings.each do |property_listing| %>
|
47
|
+
<tr>
|
48
|
+
<td><%= property_listing.listing_title %></td>
|
49
|
+
<td><%= property_listing.listing_price %></td>
|
50
|
+
<td><%= property_listing.listing_year_built %></td>
|
51
|
+
<td><%= property_listing.listing_type %></td>
|
52
|
+
<td><%= property_listing.listing_status %></td>
|
53
|
+
<td><div class="btn-group d-flex" role="group" aria-label="Property Listings">
|
54
|
+
<%= link_to 'Details', property_listing, class: "btn btn-primary btn-xs" %>
|
55
|
+
<%= link_to 'Update', edit_property_listing_path(property_listing), class: "btn btn-primary btn-xs" %>
|
56
|
+
<%= link_to 'Remove', property_listing, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'Are you sure?' } %>
|
57
|
+
</div></td>
|
58
|
+
</tr>
|
59
|
+
<% end %>
|
60
|
+
</tbody>
|
61
|
+
</table>
|
62
|
+
<%= link_to phcdevworks_real_estate.new_property_listing_path, class: "btn btn-primary" do %>
|
63
|
+
<i class="fas fa-plus-circle"></i>
|
64
|
+
<%= "Add a New Listing" %>
|
65
|
+
<% end %>
|
66
|
+
</div>
|
67
|
+
<!-- Table - Property Index -->
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
<!-- Page Content -->
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!-- Title System -->
|
2
|
+
<% phc_title "Property Listing Manager" %>
|
3
|
+
<% phc_title_tagline "New Property Listing" %>
|
4
|
+
<% phc_breadcrumb_one link_to "Property" %>
|
5
|
+
<% phc_breadcrumb_two link_to "Listings" %>
|
6
|
+
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
+
<!-- Title System -->
|
8
|
+
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_three) %></li>
|
14
|
+
</ol>
|
15
|
+
<!-- Page Bradcrumbs -->
|
16
|
+
|
17
|
+
<!-- Page Header -->
|
18
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
19
|
+
<!-- Page Header -->
|
20
|
+
|
21
|
+
<!-- Page Content -->
|
22
|
+
<div class="panel panel-inverse">
|
23
|
+
<div class="panel-heading">
|
24
|
+
<div class="panel-heading-btn">
|
25
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
|
26
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-redo"></i></a>
|
27
|
+
<a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
|
28
|
+
</div>
|
29
|
+
<h4 class="panel-title"><%= yield(:phc_title_tagline) %></h4>
|
30
|
+
</div>
|
31
|
+
<div class="panel-body">
|
32
|
+
<!-- New Form Property Listings -->
|
33
|
+
<%= render 'form', property_listing: @property_listing %>
|
34
|
+
<!-- New Form Property Listings -->
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<!-- Page Content -->
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<!-- Title System -->
|
2
|
+
<% phc_title "Property Listing Manager" %>
|
3
|
+
<% phc_title_tagline "Property Listing Details" %>
|
4
|
+
<% phc_breadcrumb_one link_to "Property" %>
|
5
|
+
<% phc_breadcrumb_two link_to "Listings" %>
|
6
|
+
<% phc_breadcrumb_three yield(:phc_title_tagline) %>
|
7
|
+
<!-- Title System -->
|
8
|
+
|
9
|
+
<!-- Page Bradcrumbs -->
|
10
|
+
<ol class="breadcrumb pull-right">
|
11
|
+
<li class="breadcrumb-item"><%= yield(:phc_breadcrumb_one) %></li>
|
12
|
+
<li class="breadcrumb-item active"><%= yield(:phc_breadcrumb_two) %></li>
|
13
|
+
</ol>
|
14
|
+
<!-- Page Bradcrumbs -->
|
15
|
+
|
16
|
+
<!-- Page Header -->
|
17
|
+
<h1 class="page-header"><%= yield(:phc_title) %></h1>
|
18
|
+
<!-- Page Header -->
|
19
|
+
|
20
|
+
<!-- Page Content -->
|
21
|
+
<div class="row">
|
22
|
+
|
23
|
+
<!-- Button Panel -->
|
24
|
+
<div class="col-lg-4">
|
25
|
+
|
26
|
+
<div class="panel panel-inverse">
|
27
|
+
<div class="panel-heading text-center">
|
28
|
+
<h4 class="panel-title">Options Panel</h4>
|
29
|
+
</div>
|
30
|
+
<div class="panel-body">
|
31
|
+
|
32
|
+
<div class="btn-group d-flex" role="group">
|
33
|
+
<%= link_to 'Update', phcdevworks_real_estate.edit_property_listing_path, class: "btn btn-primary" %>
|
34
|
+
<%= link_to 'Remove', phcdevworks_real_estate.property_listing_path, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
</div>
|
41
|
+
<!-- Button Panel -->
|
42
|
+
|
43
|
+
<!-- Main Panel -->
|
44
|
+
<div class="col-lg-8">
|
45
|
+
|
46
|
+
</div>
|
47
|
+
<!-- Main Panel -->
|
48
|
+
|
49
|
+
</div>
|
50
|
+
<!-- Page Content -->
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# FriendlyId Global Configuration
|
2
|
+
#
|
3
|
+
# Use this to set up shared configuration options for your entire application.
|
4
|
+
# Any of the configuration options shown here can also be applied to single
|
5
|
+
# models by passing arguments to the `friendly_id` class method or defining
|
6
|
+
# methods in your model.
|
7
|
+
#
|
8
|
+
# To learn more, check out the guide:
|
9
|
+
#
|
10
|
+
# http://norman.github.io/friendly_id/file.Guide.html
|
11
|
+
|
12
|
+
FriendlyId.defaults do |config|
|
13
|
+
# ## Reserved Words
|
14
|
+
#
|
15
|
+
# Some words could conflict with Rails's routes when used as slugs, or are
|
16
|
+
# undesirable to allow as slugs. Edit this list as needed for your app.
|
17
|
+
config.use :reserved
|
18
|
+
|
19
|
+
config.reserved_words = %w(new edit index session login logout users admin
|
20
|
+
stylesheets assets javascripts images)
|
21
|
+
|
22
|
+
# This adds an option to treat reserved words as conflicts rather than exceptions.
|
23
|
+
# When there is no good candidate, a UUID will be appended, matching the existing
|
24
|
+
# conflict behavior.
|
25
|
+
|
26
|
+
# config.treat_reserved_as_conflict = true
|
27
|
+
|
28
|
+
# ## Friendly Finders
|
29
|
+
#
|
30
|
+
# Uncomment this to use friendly finders in all models. By default, if
|
31
|
+
# you wish to find a record by its friendly id, you must do:
|
32
|
+
#
|
33
|
+
# MyModel.friendly.find('foo')
|
34
|
+
#
|
35
|
+
# If you uncomment this, you can do:
|
36
|
+
#
|
37
|
+
# MyModel.find('foo')
|
38
|
+
#
|
39
|
+
# This is significantly more convenient but may not be appropriate for
|
40
|
+
# all applications, so you must explicity opt-in to this behavior. You can
|
41
|
+
# always also configure it on a per-model basis if you prefer.
|
42
|
+
#
|
43
|
+
# Something else to consider is that using the :finders addon boosts
|
44
|
+
# performance because it will avoid Rails-internal code that makes runtime
|
45
|
+
# calls to `Module.extend`.
|
46
|
+
#
|
47
|
+
# config.use :finders
|
48
|
+
#
|
49
|
+
# ## Slugs
|
50
|
+
#
|
51
|
+
# Most applications will use the :slugged module everywhere. If you wish
|
52
|
+
# to do so, uncomment the following line.
|
53
|
+
#
|
54
|
+
# config.use :slugged
|
55
|
+
#
|
56
|
+
# By default, FriendlyId's :slugged addon expects the slug column to be named
|
57
|
+
# 'slug', but you can change it if you wish.
|
58
|
+
#
|
59
|
+
# config.slug_column = 'slug'
|
60
|
+
#
|
61
|
+
# By default, slug has no size limit, but you can change it if you wish.
|
62
|
+
#
|
63
|
+
# config.slug_limit = 255
|
64
|
+
#
|
65
|
+
# When FriendlyId can not generate a unique ID from your base method, it appends
|
66
|
+
# a UUID, separated by a single dash. You can configure the character used as the
|
67
|
+
# separator. If you're upgrading from FriendlyId 4, you may wish to replace this
|
68
|
+
# with two dashes.
|
69
|
+
#
|
70
|
+
# config.sequence_separator = '-'
|
71
|
+
#
|
72
|
+
# Note that you must use the :slugged addon **prior** to the line which
|
73
|
+
# configures the sequence separator, or else FriendlyId will raise an undefined
|
74
|
+
# method error.
|
75
|
+
#
|
76
|
+
# ## Tips and Tricks
|
77
|
+
#
|
78
|
+
# ### Controlling when slugs are generated
|
79
|
+
#
|
80
|
+
# As of FriendlyId 5.0, new slugs are generated only when the slug field is
|
81
|
+
# nil, but if you're using a column as your base method can change this
|
82
|
+
# behavior by overriding the `should_generate_new_friendly_id?` method that
|
83
|
+
# FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
|
84
|
+
# more like 4.0.
|
85
|
+
# Note: Use(include) Slugged module in the config if using the anonymous module.
|
86
|
+
# If you have `friendly_id :name, use: slugged` in the model, Slugged module
|
87
|
+
# is included after the anonymous module defined in the initializer, so it
|
88
|
+
# overrides the `should_generate_new_friendly_id?` method from the anonymous module.
|
89
|
+
#
|
90
|
+
# config.use :slugged
|
91
|
+
# config.use Module.new {
|
92
|
+
# def should_generate_new_friendly_id?
|
93
|
+
# slug.blank? || <your_column_name_here>_changed?
|
94
|
+
# end
|
95
|
+
# }
|
96
|
+
#
|
97
|
+
# FriendlyId uses Rails's `parameterize` method to generate slugs, but for
|
98
|
+
# languages that don't use the Roman alphabet, that's not usually sufficient.
|
99
|
+
# Here we use the Babosa library to transliterate Russian Cyrillic slugs to
|
100
|
+
# ASCII. If you use this, don't forget to add "babosa" to your Gemfile.
|
101
|
+
#
|
102
|
+
# config.use Module.new {
|
103
|
+
# def normalize_friendly_id(text)
|
104
|
+
# text.to_slug.normalize! :transliterations => [:russian, :latin]
|
105
|
+
# end
|
106
|
+
# }
|
107
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
PhcdevworksRealEstate::Engine.routes.draw do
|
2
|
+
|
3
|
+
# Applications Admin Area
|
4
|
+
namespace :admin do
|
5
|
+
resources :listings
|
6
|
+
resources :features
|
7
|
+
end
|
8
|
+
|
9
|
+
# Applications User Area
|
10
|
+
namespace :property do
|
11
|
+
resources :listings
|
12
|
+
resources :features
|
13
|
+
end
|
14
|
+
|
15
|
+
# Mount Routes
|
16
|
+
mount PhcdevworksAccounts::Engine, :at => '/'
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class CreatePhcdevworksRealEstatePropertyListings < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :phcdevworks_real_estate_property_listings do |t|
|
4
|
+
|
5
|
+
t.string :listing_title
|
6
|
+
t.text :listing_description
|
7
|
+
t.string :listing_street_address
|
8
|
+
t.string :listing_price
|
9
|
+
|
10
|
+
t.string :listing_area
|
11
|
+
t.string :listing_property_area
|
12
|
+
t.string :listing_garage_area
|
13
|
+
|
14
|
+
t.string :listing_room
|
15
|
+
t.string :listing_bed
|
16
|
+
t.string :listing_bath
|
17
|
+
t.string :listing_garage
|
18
|
+
|
19
|
+
t.string :listing_type
|
20
|
+
t.string :listing_status
|
21
|
+
|
22
|
+
t.string :listing_year_built
|
23
|
+
t.string :listing_energy_class
|
24
|
+
t.string :listing_leed_rating
|
25
|
+
|
26
|
+
t.string :slug
|
27
|
+
t.string :user_id
|
28
|
+
t.string :org_id
|
29
|
+
|
30
|
+
t.timestamps
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|