diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index c07a05c..dd9b0b4 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -343,7 +343,7 @@ class AsksController < ApplicationController } ] end.to_h - ask_questions = AskQuestion.where(:situation => 'is_published', :category_id.in => category_ids) + ask_questions = AskQuestion.where(:situation => 'is_published', :category_id.in => category_ids).order_by(created_at: :desc) if page_data_count != 0 ask_questions = ask_questions.page(1).per(page_data_count) end @@ -724,7 +724,7 @@ class AsksController < ApplicationController id = field_name case field when 'title' - f1['content'] = text_field_tag(field_name,nil,placeholder: placeholder,required: required) + f1['content'] = text_area_tag(field_name,nil,placeholder: placeholder,required: required) when 'name' f1['content'] = text_field_tag(field_name,nil,data: (required ? {"fv-validation" => "required;", "fv-messages" => "必填欄位;"} : {}),required: required,placeholder: placeholder) when 'sex' diff --git a/app/views/asks/show.html.erb b/app/views/asks/show.html.erb index 1a8d0bb..04e6826 100644 --- a/app/views/asks/show.html.erb +++ b/app/views/asks/show.html.erb @@ -67,6 +67,14 @@ <%= label_tag nil,ask.title, :class=> 'control-label' %> + <% if ask.name.present? %> +