Now this action in this controller is called by remote ajax call.
Only when the checkbox[:call] was checked and it's submit,
I'd like make it to redirect to ......_path with flash message.
Is it possible? if possible, how?
controller
.....
if params[:comment][:call] == "1"
flash[:notice] = "you checked and submit!"
redirect_to ....._path
else
ajax page reload
end
view Form (remote with ajax)
<%=form_for(([@community, @comment]), :remote => true, :class => 'form' ) do |f| %>
<%= f.check_box :call, :label => 'call' %> call
<div class="form-actions">
<div class="input-append">
<%= f.text_field :body, :id => "input", :class => "box" %>
<button type="submit" class="btn">submit</button>
</div>
</div>
<% end %>
Comment model
attr_accessible :icon, :call
....
def call
@call ||= "0"
end
def call=(value)
@call = value
end