FIX: linking to house ads URLs shows not found error page
This commit is contained in:
parent
d9d7f4c8f4
commit
cdc14398ba
|
@ -9,6 +9,10 @@ module ::AdPlugin
|
|||
)
|
||||
end
|
||||
|
||||
def show
|
||||
render_json_dump(house_ad: HouseAd.find(params[:id])&.to_hash)
|
||||
end
|
||||
|
||||
def create
|
||||
ad = HouseAd.create(house_ad_params)
|
||||
if ad.valid?
|
||||
|
|
|
@ -2,7 +2,7 @@ export default {
|
|||
resource: "admin.adminPlugins",
|
||||
path: "/plugins",
|
||||
map() {
|
||||
this.route("houseAds", { path: "/house-ads" }, function() {
|
||||
this.route("houseAds", { path: "/adplugin/house_ads" }, function() {
|
||||
this.route("index", { path: "/" });
|
||||
this.route("show", { path: "/:ad_id" });
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ after_initialize do
|
|||
|
||||
AdPlugin::Engine.routes.draw do
|
||||
root to: 'house_ads#index'
|
||||
resources :house_ads, only: [:index, :create, :update, :destroy]
|
||||
resources :house_ads, only: [:index, :show, :create, :update, :destroy]
|
||||
resources :house_ad_settings, only: [:update]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue