similar to: Newbie question on ordering e.g. @post.comments

Displaying 20 results from an estimated 20000 matches similar to: "Newbie question on ordering e.g. @post.comments"

2006 Apr 14
4
Newbie stuff (.new method)
Hi- Ruby 1.8.2 Rails 1.1 so I''m trying to build my first rails app and I''m trying to understand how the helper methods work. For instance .new & .save . For instance, I''ve created a table of Objects, and generated a scaffold. I see that in the controller, there are calls to Object.new and Object.save. I''m assuming that these are methods inherited
2006 Mar 16
3
How to paginate in descending order?
How can I paginate a set of fields in descending order based on their created_on date? For example, in a blog app, you want the very first entry on the first page to be the most recent. I see that paginate has an :order parameter, but I don''t see any way of changing the direction of the order. Thanks, Jeff Coleman -- Posted via http://www.ruby-forum.com/.
2005 Apr 20
7
find_all_by and :order
I think I must be missing something obvious... I have... class OrderController < ApplicationController model :order scaffold :order def list @orders = Order.find_all_by_status(@params[:status], :order => "date" ) end end class Order < ActiveRecord::Base belongs_to :customer end and i''m getting... /Unknown column ''orderdate'' in
2011 Nov 08
0
[LLVMdev] Newbie Question: How are the values set in a Sparc store instruction (e.g. STri)?
I'm a bit confused as to how some of the values in a Sparc store instruction actually come to be set. The Sparc backend defines a store as: def STri : F3_2<3, 0b000100, (outs), (ins MEMri:$addr, IntRegs:$src), "st $src, [$addr]", [(store IntRegs:$src, ADDRri:$addr)]>; F3_2 and it's superclasses are defined as follows:
2006 Jun 05
7
Building a UK based e-commerce store in rails
I have built a few sites with Rails, however I have been approached by a company wanting an e-commerce / online shop built. I would love to build one in rails with the knoweledge I now have. I have the agile book and the pickaxe book they are my reference guide. However there is virtually nothing on creating real world e-commerce sites in rails. They will be selling to both businesses and the
2006 Mar 30
4
Simple Ruby/Rails question, doing posted hours ago
I am not the Ruby aficionado yet, if I have created_on ...timestamp. What is a ruby way of getting the hours/minutes/seconds ago. is there some class that has this implemented. For example: Posted on 3/28/2006 Show a time with: posted: 1 day ago ... something along those lines. -- Berlin Brown (ramaza3 on freenode) http://www.newspiritcompany.com also checkout alpha version of botverse:
2006 Jun 30
4
Posting error: Ruby On Rails mailing list archieve
You do not have permission to post to group railinglist. You may need to join the group before being allowed to post, or this group may not be open to posting. Visit http://groups.google.com/group/railinglist/about to join or learn more about who is allowed to post to the group. Help on using Google Groups is also available at: http://groups.google.com/support -------------- next part
2005 Mar 09
21
Converting time retrieved from MySQL
I''m having a problem converting a date retrieved from my MySQL database and I''m hoping someone can help. MySQL stores the date/time as this: 2005-03-08 17:00:34.0 and according to my Pickaxe book Ruby stores times as "the number of seconds and microseconds since [...] January 1, 1970". All well and good. Unfortunately, RoR is converting my date to this:
2006 Jul 14
20
Method for associated relationships
I have these tables set up like this: listings has_many :states <field>state_id [int] <other fields.... .............. .............> states belongs_to: listings <field>name <other fields.. ............... .................> In my view I have <%= listing.name %> have also tried listing.state_id.name , that didn''t seem to do the magic either. This
2005 Dec 19
3
created_on, created_at defaulting to 2000/01/01 00:00:00
Hello all, Rails 1.0.0 created_on is being set to 2000/01/01 00:00:00 Any ideas on this ? Thanks! Schema is create table user_login_history ( id int identity(1,1) not null, user_id int not null, created_on datetime default(getdate()) not null, created_at datetime default(getdate()) not null, updated_on datetime default(getdate()) not null, constraint pk_user_login_history primary key clustered
2006 May 09
0
Newbie question: How to remote login
Hi Can anyone tell me what the basic steps are to do a remote login? I''ve got an app using the acts_as_authenticated plugin, and want to add some forum functionality. Opinion (http://home.leetsoft.com/Opinion) says it has the ability to remote login users but no documentation. And I''m afraid I don''t really know where to start trying to tie this in. If anyone could
2004 Jul 07
1
fedora core 2 + bitmap() + ghostscript (PR#7062)
Hi all, A bug popped up recently when I upgraded to fedora core 2 (from core 1). Whenever I used the bitmap() function, ghostscript complained that it couldn't handle png or tiff devices. This was NOT a bug with R. It was with the version of ghostscript shipped with core 2. Going to rawhide and getting ghostscript 7.07-29 (core 2 comes with 7.07-25) solved this problem. Unfortunately, I
2006 Feb 22
2
Newbie seeks helps ordering ancestors from acts_as_tree
I''m sure this is really obvious but I''m feeling my way here with rails (and Ruby) and have tried a couple of things without success. So, can anyone tell me the best way to reverse order the retuen list of ancestors. In the controller I have: @ancestors = @category.ancestors which returns an array starting at the parent and ending with the root. When I then loop through the
2006 Apr 20
5
Noobie problems with helper
I have the following helper method in application_helper.rb: def format_date(date) day = to_s(date.day) month = to_s(date.month) time = to_s(date.time) date = day + "/" + month + " - " + time return date end I am trying to call this method in a view like this: <%= format_date(bounty.created_on) %> create_on is a timestamp in mysql. I am
2005 Dec 23
4
OO model style: inheritance
Hi everybody I am totally new to rails and I am trying to start a tiny project to get familiar with rails. But I already got my first problem and I would be happy if somebody could point me in the best and cleanest direction. I am trying to develop a small gallery app. Since I would like to add more features in future I am trying to design a clean OO architecture of my models: The base object
2006 Jan 26
9
Problem with schema_db_import on Site5?
Hello, I am trying to put my rails app on a host .So I presume the method to do this is to first do rake db_schema_dump and then copy it to the host and do rake db_schema_import. I use mySQL Ver 14.7 Distrib 4.1.14, for pc-linux-gnu (i686) using readline 4.3 ** Invoke db_schema_import (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db_schema_import rake
2005 Mar 10
10
Some Basic Questions
Sorry I can''t access IRC from work so I hope you don''t mind me asking my newbie questions here: 1) I have the following code: @post = Post.find(@params[''id'']) @comments = Comment.find_all "post_id = #@params[''id'']", "created_on ASC" And I am have problems with the second line. I want to pass the id from my post to the
2006 Mar 31
2
A.R. Associations problem
Hello, I''m learning A.R Associations by creating a simple forum that consists of 3 tables: ahuthors, topics and posts. This is the schema: class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration def self.up create_table :authors do |t| t.column :username, :string t.column :email, :string t.column :created_on, :datetime end create_table
2020 Oct 16
2
Customized theme for Syslinux.cfg
Thank you Gregory your code worked to remove the border in syslinux! It wasn?t the Alpha (that changes the opacity of the border color), but it was the ?shadowing? that had to be changed, so ?none? in the shadowing column worked(you notice the border come back if you change ?none? to ?std?) reference this link for terms: https://wiki.syslinux.org/wiki/index.php?title=Menu#MENU_COLOR ! I am also
2006 Jun 13
2
four days on rails - nil object when you didnt expect it
Hi all, Im trying to get my head around rails and to help along Im working through "four days on rails" as this seems to give a good real world example with multiple tables and relationships (the main thing I cant work out!) Ive got stuck. Some help would be really good here. The controller has this code: def list @category_pages, @categories = paginate(:category, :per_page =>