johnkock / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

When ran with mod_rails show_by_tag breaks with only one tag #190

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Configure your Substruct site to run under Apache with Phusion Passenger
(mod_rails)
2. Navigate to a single tag, [yoursite]/store/show_by_tag/[tag]

What is the expected output? What do you see instead?
I expected to see a store page showing the contents of the specified tag.
Instead I got an error from the store_controller.rb on line 79.

What version of the product are you using? On what operating system?
Substruct 1.0.a7
Ubuntu Hardy (2.6.24-24-server and 2.6.31-302-rs)
Phusion Passenger 2.2.7

Please provide any additional information below.

The problem is actually on line 76 of the store_controller

Replace this
@tag_names = params[:tags]
with this
@tag_names = params[:tags] || params[:id]

It seems that mod_rails doesn't send a single tag as "tags" in the
parameter string but it rewrites the single tag as "id" instead. Replacing
line 76 with this slightly modified version fixes the issue, so that if
there isn't a "tags" parameter then it'll use the "id" parameter instead.

Original issue reported on code.google.com by dlredde...@gmail.com on 10 Dec 2009 at 9:51

GoogleCodeExporter commented 8 years ago
Not sure this is still happening.

Original comment by subim...@gmail.com on 26 Aug 2010 at 5:45