I want @messages to return @ folder.messages, where the value of the "deleted" column is not true. I am not sure why this continues to throw an SQLException. I think I did not format the deleted attribute properly, but I am not sure how to fix it.
Any help would be greatly appreciated. Thanks in advance.
Error message:
ActiveRecord::StatementInvalid in MailboxController#index SQLite3::SQLException: no such column: true: SELECT "message_copies".* FROM "message_copies" WHERE ("message_copies".folder_id = 1) AND (deleted != true)
Application Trace:
app/controllers/mailbox_controller.rb:14:in `show' app/controllers/mailbox_controller.rb:5:in `index'
Mailbox_Controller.rb
1 class MailboxController < ApplicationController 2 def index 3 current_user = User.find(session[:user_id]) 4 @folder = Folder.where("user_id = #{current_user.id}").first 5 show 6 render :action => "show" 7 end 8 9 def show 10 current_user = User.find(session[:user_id]) 11 @folder = Folder.where("user_id = #{current_user.id}").first 12 @msgs = @folder.messages 13 @ms = @msgs.where("deleted != true") 14 @messages = @ms.all.paginate :per_page => 10, 15 :page => params[:page], :include => :message, 16 :order => "messages.created_at DESC" 17 end 18 end
ruby-on-rails sqlite ruby-on-rails-3 sqlite3-ruby sqlexception
user714001
source share