mirror of
https://github.com/discourse/discourse-adplugin.git
synced 2025-02-17 00:45:15 +00:00
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
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
render_json_dump(house_ad: HouseAd.find(params[:id])&.to_hash)
|
||||||
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
ad = HouseAd.create(house_ad_params)
|
ad = HouseAd.create(house_ad_params)
|
||||||
if ad.valid?
|
if ad.valid?
|
||||||
|
@ -2,7 +2,7 @@ export default {
|
|||||||
resource: "admin.adminPlugins",
|
resource: "admin.adminPlugins",
|
||||||
path: "/plugins",
|
path: "/plugins",
|
||||||
map() {
|
map() {
|
||||||
this.route("houseAds", { path: "/house-ads" }, function() {
|
this.route("houseAds", { path: "/adplugin/house_ads" }, function() {
|
||||||
this.route("index", { path: "/" });
|
this.route("index", { path: "/" });
|
||||||
this.route("show", { path: "/:ad_id" });
|
this.route("show", { path: "/:ad_id" });
|
||||||
});
|
});
|
||||||
|
@ -54,7 +54,7 @@ after_initialize do
|
|||||||
|
|
||||||
AdPlugin::Engine.routes.draw do
|
AdPlugin::Engine.routes.draw do
|
||||||
root to: 'house_ads#index'
|
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]
|
resources :house_ad_settings, only: [:update]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user