Displaying 7 results from an estimated 7 matches for "sort_direction".
Did you mean:
font_direction
2006 Jan 10
1
sql server freetds/odbc question
...erecord/lib/active_record/base.rb:931:in
`add_limit!''
/vendor/rails/activerecord/lib/active_record/base.rb:924:in
`construct_finder_sql''
Any help appreciated!
Jamie
------
class ActionController::Base
def paginate_with_sort(collection_id, options={})
@params[:sort_direction] ||= ''-1''
asc_desc = {''1'' => "asc", ''-1'' => "desc"}
options[:order] = "#{@params[:sort_by]} #{asc_desc[@params
[:sort_direction]]}" if @params[:sort_by]
@params[:sort_direction] = @params[:sort...
2006 Jan 10
1
sql server & linux: left join problem
.../vendor/rails/actionpack/lib/action_controller/pagination.rb:
124:in `paginate''
/lib/sorting.rb:7:in `paginate_with_sort''
Any ideas appreciated.
Thanks,
Jamie
-------------
class ActionController::Base
def paginate_with_sort(collection_id, options={})
@params[:sort_direction] ||= ''-1''
asc_desc = {''1'' => "asc", ''-1'' => "desc"}
options[:order] = "#{@params[:sort_by]} #{asc_desc[@params
[:sort_direction]]}" if @params[:sort_by]
@params[:sort_direction] = @params[:sort...
2006 May 15
1
Ajax Scaffold is htmlescaping "&" in url''s
Seems like I have a problem with html escaping of "&" in my
url''s. "Create New" have following link:
http://localhost:3000/stylesheets/new?scaffold_id=stylesheet&page=1&sort_direction=asc
Any ideas how I can fix this?
Using:
ajax_scaffold_generator (3.1.2) &
rails (1.1.2)
Regards Henrik
2012 Mar 06
0
Devise/Cancan Signout User On Controller Action
...:read, :all
elsif user.role == 2 #Vendor
can :manage, VendorTransaction
can :index, Account
end
end
end
Ok Here is my Transaction controller
require ''csv''
class TransactionsController < ApplicationController
load_and_authorize_resource
helper_method :sort_column, :sort_direction
respond_to :html, :js
def index
per_page = 40
@transactions = Transaction.search(params[:id]).order(sort_column + "
" + sort_direction)
respond_to do |format|
format.html # index.html.erb
format.csv { render :csv => @transactions}
end
AND Account Controller
class Accounts...
2005 Nov 03
9
[Idea] session-wide persistent variables
I was thinking about having instance variable stored and fetched from
session container automatically before calling an action and after the
action is finished. Using methodology of accessors it would look like:
class MyController < ActionController::Base
persistent_attr :person
def alfa
person = ''John Smith''
# render as usual view alfa.rhtml with anchor
2007 Oct 15
6
SQL injection with :order, :limit, :group
I know how to avoid SQL injection attacks when you use :conditions
User.find :first, :conditions => ["login=?", params[:username]]
but how about with :order, :limit or :group?
# uh-oh...spaghetti-oh
User.find :first, :order => "login; delete from users; select * from users"
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you
2013 Apr 03
2
strange behavior with active relation any? method
...ick on the
second page using kaminari:
@drivers = Driver.select("drivers.*, #{sort_column}")
.joins([:reports, :driving_habits])
.by_month(for_selected_month.to_i,
for_selected_year.to_i)
.order(sort_column + " " + sort_direction)
.page(params[:page]).per(1)
puts "The drivers #{@drivers.inspect}"
What''s driving all this weird behavior?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this gr...