English 中文(简体)
铁路3 - 租船舱安排不工作
原标题:Rails 3 - Ancestry gem method arrange not working
最佳回答

我用祖传的宝石,对我课以罚款。 e.g:

 require  awesome_print                   # just for nice demo output
 ap  Account.arrange(:order => :id) ; 1   

您需要接下去。 类别本身——等级方法

• 铁路公司

问题回答

页: 1

主计长:

def index
  @categories = Category.arrange(:order => :created_at)

  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @categories }
  end
end

页: 1 观点:

<%= nested_categories @categories %>

使用铁路3的Im和“Ancestry”gem似乎大大替代了“Act树” g。





相关问题
Ruby net-dns reverse lookups

I am trying to get reverse DNS lookups working with the net-dns gem for ruby. From the rdoc res = Net::DNS::Resolver.new ip = IPAddr.new("172.16.100.2") packet = res.search(ip) packet = res.search("...

How can I show updates with gem?

I want on my webserver a script that checks automatical over cron if there are gem updates without installing updates. I don t find anything about this task in the gem docs.

missing rake tasks?

I have ran gem install rails and am running 2.3.4 but i am missing some rake tasks like db and gems if i run rake -T i get the following tasks. How can i get all the others ? rake apache2 # ...

Ruby Daemons Gem

I installed the ruby gem Daemons. To make sure it was working I created a script that would print to a file every 5 seconds. I then created another file to run the script using the trivial example ...

Ruby gems repository

I m trying to set a gem repository on one of our local servers. Here are the steps I m running, that I ve followed from several guides. 1) I create the BASEDIR folder /var/www/html/gems 2) sudo cp -...

Search logic functionality

The functionality I m looking for: I have a form that will search my Proposal model. I want the form to contain a select box and display the categories I have. Now, category is merely a column in ...

Ruby Geolocation Gem/Plugins [closed]

What are the available (best) ruby IP-based geolocation gem/plugins? How do they compare to one another in terms of functionality, performance and ease of use (e.g. do they interact with a web ...

How do I find gems that depend on a given gem?

Is it possible to search for all gems that rely on a certain rubygem? For example, I d like to ask for all gems in gemcutter that rely on the test-unit gem. Background: I m looking to see how other ...

热门标签