Posted By

radio_g on 04/15/07


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Knosk Main Controller, Early


 / Published in: Rails
 

URL: www.knosk.com

@qtext does not become available in the view. however, this code has worked inside the view.

  1. class KnoskController < ApplicationController
  2.  
  3. def ask
  4. # sets and formats the question
  5. # if one has been posted
  6.  
  7. @qtext = params[:question][:qtext]
  8. if @qtext then
  9. @qtext.capitalize!
  10. @qtext.gsub!(" i ", " I ")
  11. if !@qtext.rindex("?") then @qtext << "?"
  12. end
  13.  
  14. # adds the question to the database
  15. # if one was posted here
  16. end
  17.  
  18. def search
  19. end
  20.  
  21. def answer
  22. end
  23.  
  24. def about
  25. end
  26.  
  27. def options
  28. end
  29.  
  30. end

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Jargon on April 15, 2007

def ask

sets and formats the question

if one has been posted

@qtext = params[:question][:qtext] if @qtext @qtext.capitalize! @qtext.gsub!(" i ", " I ") @qtext << "?" unless @qtext.rindex("?") end

adds the question to the database

if one was posted here

end

You need to login to post a comment.