logic separation for join table requests

This commit is contained in:
2012-09-17 15:39:36 +02:00
parent 77258bbd6d
commit c573c83c4c
4 changed files with 26 additions and 5 deletions
+11 -2
View File
@@ -3,7 +3,16 @@
.form-actions
= link_to t('user.join_occupied_table.back'), user_root_path, class: :btn
'
= link_to t('user.join_occupied_table.show_the_products'), user_list_products_for_table_path(table_id: @table.id), class: [:btn, 'btn-primary']
= link_to t('user.join_occupied_table.show_the_products'), user_root_path(message: 'cannot_identify_table'), class: [:btn, 'btn-primary'], id: 'join_table_products'
'
button.btn.btn-warning{onClick="Quser.join_occupied_table('#{@table.id}')"} = t('user.join_occupied_table.join_this_table')
button.btn.btn-warning{onClick="Quser.join_occupied_table()"} = t('user.join_occupied_table.join_this_table')
#join-occupied-table-progress-container
- content_for :footer do
javascript:
$(function(){
var list_products_for_table_base = '#{raw user_list_products_for_table_path}';
var match = window.document.URL.toString().match('table_id=([0-9a-zA-Z]+)');
if(match){
$('#join_table_products').attr('href', list_products_for_table_base + '?table_id=' + match[1]);
}
});