Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > (WILL PAY) Blog combined with reading

Reply
Thread Tools

(WILL PAY) Blog combined with reading

 
 
Tiger Big one
Guest
Posts: n/a
 
      04-18-2010
Blog:
http://sixrevisions.com/web-developm...ruby-on-rails/

I will pay for someone to solve this problem for me! post ur email or
msn or yim!

Basically, what i got at the moment that works is the reading, ADD and
EDIT and delete posts that people have made, i have also added a
friendship so only friends of that person can view the post.

What i want to achieve now is that users can comment on that post! This
is the hard thing and i dont understand how i can combine the commenting
system with my own reading system.

Also, i have done some tests but i really need some help! in my
view/reading i only have the add.rhtml and edit.rhtml. In the userhub
page, i have the current code:
######################################

app/view/user/index.rhtml
######################################
<% @user.reading.each do |reading| %>
<div id="hubtwo"><u>Book:</u> <%= reading.name %><br />

<u>Description:</u> <%= reading.description %></div>
<%= link_to "Edit",
:controller => :reading,
:action => :edit,
:id => reading.id %> |
<%= link_to "Delete",
:controller => :reading,
:action => :delete,
:id => reading.id %>

<% end %>
######################################

Reading File?: Controller is called "reading"

Made this myself:

######################################

reading_controller.rb
######################################

class ReadingController < ApplicationController

before_filter rotect

def add
@title = "Add a New Reading Material"

if request.post?
@reading = Reading.new(params[:reading])
@reading.user_id = User.logged_in(session).id
if @reading.save
flash[:notice] = "Reading #{@reading.name} added!"
redirect_to :controller => :user, :action => :index
end
end
end

def edit
@title = "Edit a Reading material"
@reading = Reading.find(params[:id])
if request.post?
if @reading.update_attributes(params[:reading])
flash[:notice] = "Reading #{@reading.name} updated!"
redirect_to :controller => :user, :action => :index
end
end
end

def delete
@reading = Reading.find(params[:id])
flash[:notice] = "Reading #{@reading.name} deleted!"
@reading.destroy
redirect_to :controller => :user, :action => :index
end


private
# Protect a page against not logged users
def protect
unless User.logged_in?(session)
flash[:notice] = "Please login first"
redirect_to :controller => :user, :action => :login
return false
end
end
end
######################################
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Tiger Big one
Guest
Posts: n/a
 
      04-18-2010
Anyone???
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      04-19-2010

On Apr 18, 2010, at 14:35 , Tiger Big one wrote:

> Anyone???


You didn't get your answer within 2.5 hours... maybe you should be more =
patient. But I'd also suggest you email/post on a ruby on rails =
list/forum, not one dedicated to ruby.


 
Reply With Quote
 
jzakiya
Guest
Posts: n/a
 
      04-19-2010
On Apr 18, 8:20*pm, Ryan Davis <ryand-r...@zenspider.com> wrote:
> On Apr 18, 2010, at 14:35 , Tiger Big one wrote:
>
> > Anyone???

>
> You didn't get your answer within 2.5 hours... maybe you should be more patient. But I'd also suggest you email/post on a ruby on rails list/forum, not one dedicated to ruby.


Take a look at Hobo too. It just went 1.0.

http://hobocentral.net/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hi its a very useful blog visit this blog gikklu C Programming 0 11-24-2009 04:15 PM
New Blog form Net Programing and Blog IT competition zegga ASP .Net 0 08-01-2009 05:38 AM
have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much)have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much) justpratik Python 0 06-08-2007 04:48 AM
blog blog blog John Computer Information 0 02-13-2005 10:20 AM
anyone else find errors in MeasureUp combined 70-292 / 70-296 cd simulations? Beoweolf MCSE 0 12-28-2004 07:40 PM



Advertisments