File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
controllers/api_public/v1 Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def search
3636 properties = Pwb ::Current . website . listed_properties . properties_search ( **args )
3737
3838 # Filter by highlighted/featured if requested
39- if params [ :highlighted ] == 'true'
39+ if params [ :highlighted ] == 'true' || params [ :featured ] == 'true'
4040 properties = properties . where ( highlighted : true )
4141 end
4242
Original file line number Diff line number Diff line change @@ -90,5 +90,13 @@ def lowest_short_term_price
9090 ] . reject { |p | p . nil? || p . cents < 1 }
9191 prices . min
9292 end
93+
94+ # Returns a formatted price string for display
95+ # Automatically detects whether to show sale or rental price
96+ # @return [String, nil] formatted price string with currency
97+ def formatted_price
98+ rent_or_sale = for_rent ? "for_rent" : "for_sale"
99+ contextual_price_with_currency ( rent_or_sale )
100+ end
93101 end
94102end
Original file line number Diff line number Diff line change @@ -92,7 +92,12 @@ def resolved_url
9292 elsif link_path . present?
9393 # Generate a basic path from the route helper name
9494 path_name = link_path . gsub ( '_path' , '' )
95- "/#{ I18n . locale } /#{ path_name } "
95+ # Use link_path_params if available (e.g., for show_page_path with a slug)
96+ if link_path_params . present?
97+ "/#{ I18n . locale } /#{ link_path_params } "
98+ else
99+ "/#{ I18n . locale } /#{ path_name } "
100+ end
96101 elsif page_slug . present?
97102 "/#{ I18n . locale } /#{ page_slug } "
98103 else
You can’t perform that action at this time.
0 commit comments