Displaying 20 results from an estimated 78 matches for "post_ids".
Did you mean:
post_id
2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but
please, try to read it. I have a simply blog, with posts and their
comments. I''ve two tables in my db, posts, with post id, text and
comments_count to store the number of comments-children of each post (as
recomanded to do in AWDWR); and the table comments, with comment id,
post_id for the post
2007 May 31
4
Sample Merb App
I put together a sample app to help people learn Merb:
http://svn.depixelate.com/applications/invoice_tracker/
I also blogged about it here:
http://depixelate.com/2007/5/31/taking-merb-for-a-spin
--
Zack Chandler
http://depixelate.com
2006 Jun 08
5
Displaying Calculation on Index
Hi, I am trying to create a simple point system and display the total on
my index page. So I have my db basically setup like this:
Posts
id, body, created_at, user_id
Post_points
id, post_id, user_id, created_at, value
So as you can see I am allowing other users to create points on the post
and my db will store who gave the point as well. "value" is the point
value which can
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe
one of you guys can help me out. I''ll show my sweeper and then my log
to show that it "should" be working.
class PragmaticSweeper < ActionController::Caching::Sweeper
observe Comment
def after_save(comment)
expire_page(comment.post_id)
end
private
def expire_page(post_id)
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog.
map.resources :posts do |posts|
posts.resources :comments, :trackbacks
end
Now comments are at /posts/:post_id/comments.
Okay but what if I want to list all the comments for all the posts. It
should be at /comments, but that isn''t map that way. Can I map comments
twice?
--
Posted via http://www.ruby-forum.com/.
2009 Apr 15
2
Getting Started with Rails - post_comment_url
Hi,
Thanks for a wonderful Getting Started with Rails. I am up to the last
section and just added the comments part.
So while testing and looking over comments_controller.rb;
I see the reference to post_comment_url calll where is this defined.
Below is the message I am getting.
Thanks
ActionController::RoutingError (post_comment_url failed to generate
from {:post_id=>#<Post id: 1, name:
2009 Aug 16
5
any help with captcha in my comments ?
this is my error:
Processing ApplicationController#create (for 127.0.0.1 at 2009-08-17
00:57:56) [POST]
Parameters: {"comment"=>{"name"=>"asdasd", "body"=>"asdasd"},
"commit"=>"Add Comment", "post_id"=>"19",
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 Jul 04
8
writing to many_to_many table
I have three tables. users, posts, users_posts. This last one is to
mark a post as read.
How do I write to the users_post table?
Here''s what I have:
In model ''User_Post''
belongs_to :post
belongs_to :user
In post/view/show:
<%= link_to "Mark As Read", :controller => ''post'', :action =>
''post_read'',
:user =>
2006 Apr 20
1
Returning Count from find_by_sql
I want to return an int from a find_by_sql call. But when I use that
result to compare to another count the error tells me I have an array.
MODEL:
# Returns the number of comments in a specified post
def self.find_count(post_id)
find_by_sql(["SELECT COUNT(*) FROM commments WHERE post_id = ?",
post_id])
end
CONTROLLER:
def test
@post =
2007 Nov 12
7
schema_info always wants to be 3, even when set to 7
Hi all,
I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5
on Windows XP SP2 and Ruby 1.8.6
I have seven migrations. If I run them with an empty database, it
runs the first three, then halts. When I look in schema_info, the
version is 3.
If I run db:migrate VERSION=7, then it runs through the remaining 4
migrations, and the version is 7 in the DB.
2006 Aug 31
0
ActiveResource
I''ve been sitting on an ActiveResource patch for a few weeks, waiting
to get some feedback from David. But, I see other folks like Jeremy
are starting to use it, so I committed my patch:
http://dev.rubyonrails.org/changeset/4890
It gets all the basic operations in working order, and adds support
for prefixes. I wasn''t quite sure how to pull this off. Right now,
I''m
2006 Feb 24
4
too many components?
okay.
on /posts/show/13
i have show.rhtml, which does
render_component(:controller=>''comments'', :action=>''display_comments'',
:id=>post.id)
on comments/display_comments
i iterate through the comments and then, display_comments.rhtml
render_component(:controller=>''comments'', :action=>''new'', :id=>@id)
2006 Oct 16
6
Rails AR/Oracle Unit Test: [5310] failed (but getting better)
"rick" has given AR/Oracle some love, but it''s still unhappy...
http://dev.rubyonrails.org/changeset/5310
------------------------------------------------------------------------
r5310 | rick | 2006-10-16 08:42:55 -0700 (Mon, 16 Oct 2006) | 1 line
Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney]
2012 Mar 12
4
how to design a api?
hi,everyone.
now i start to design a api.
the url like this
http://localhost:3000/api?seckey=123&&post_id=1
the visitor need a seckey to access auth.and get info via json.
so i dont think thats a good api.
i need your answers.thx
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 Jul 03
0
Check if row already exists?
I''m working on a system that has a series od "bids" associated with
"posts". Vurrently when a bid is placed I have it creating a new row
each time in the "bids" table. The bids table has id, post_id, and
user_id.
The logic is to check to see if a bid already exists with a given
post_id and user_id. If it does, then just update the "amount"
2007 Jan 01
0
Simple question on inserting child data
after doing a bunch of reading I have finally sat down to create a
simple app to dirve home a lor of the concepts to which have been read.
So I figured a simple blog app is the best way to do it. The bad
thing is that I am already hung up when creating replies to a blog
posting.
I can''t figure out how to insert the post_id value into the reply
table. When creating a reply the user is
2006 Jan 09
1
AR: Quoting in Join Model Test
Greetings made men of rails!
I am presently writing a new database adapter for rails to bring the
OpenBase community on board. In working through the rather extensive
AR tests (which I very much appreciate), I have come across a
question I can''t seem to answer on my own.
In the test_has_many_with_piggyback(AssociationsJoinModel) the result
is expected as a quoted integer
2009 Dec 03
2
Dynamic Paths
Hey there,
I''m in the muck of a major rails project, and need a bit of advice. Google
isn''t much help in this case, so I came here.
I''m trying to set up a URL structure as follows:
url.com/username/blog/post_id
where the user has_many posts and the post belongs_to user. I''m using the
friendly_id plugin to enable easy lookup with the user''s username,
2006 Jul 22
12
Community request - can someone show me REST?
I mentioned this in another thread, but I''ve got a formal request now.
After reading tons of stuff about REST, I don''t really get it. I
need to see an example.
I''d like someone to write up an example blog app with these requirements
- RESTful using the simply_restful plugin (or edge rails)
- allows posting of comments to articles
- has categories for posts
No need