Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass category id to "Ask" link #76

Open
snytkine opened this issue Jan 22, 2012 · 0 comments
Open

pass category id to "Ask" link #76

snytkine opened this issue Jan 22, 2012 · 0 comments
Labels

Comments

@snytkine
Copy link
Owner

When "Ask" is clicked from the category view page we should pass that category id or slug to the ask controller. The reason for that is we can then make the current category 'selected' in the ask form.

One way to do this is set categoryId instance variable then the code that generates navigation tabs will use it when creating the link for the "Ask" tab.

Another way is to pass it in session, then every page view we can set the value of category_id if it's available. This will work even from the view question page. So if user viewing question then clicks on "Ask", it will make the category of previously viewed question as "selected"

Another way is to point link to relative ask/ instead of absolute /ask/ url. Then can modify rewrite rules so that if url looks like /category/mycategory/ask/ it will pass the value of 'mycategory' to controller. Then a more generic rewrite rule will rewrite anyurl followed by ask/ to the ask controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant