Knosk Main Controller, Early


/ Published in: Rails
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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

URL: www.knosk.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.