• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Recently, I've been making web sites by using Merb. It was like a battle lacking logistics.

I made and released dm-pagination on github. http://github.com/genki/dm-pagination/tree/master

Yes, I know dm-is-paginated-0.0.1, but its spec files was not working. The dm-pagination is able to be used with arbitrary collections which include scoped_query.

You can easily paginate, like this:

   1  class Posts
   2    def index
   3      @posts = Post.paginate(:page => params[:page])
   4    end

Links will be drawn by calling simple helper method.

   1  <ul>
   2  <% @posts.each do |post| %>
   3    <li><%= h(post.body) %></li>
   4  <% end %>
   5  </ul>
   6  <%= paginate @posts %>

merb_slice-gen is also available in order to provide useful generators for slices of which it has namespace but doesn't have subdirectories.

You can generate controller, resource and resource_controller in slice project, like this

   1  % slice-gen controller top

it generates controller files enclosed by SliceName module without any subdirectories.

In addition, there are other gems I made.

posted by Png takiuchi on Thu 15 Jan 2009 at 03:05

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry1217
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ