You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: