OK, I'm starting to understant,
You have
<%= form_for @question do |f| %>
<%= f.cktext_area @formatted_question[:annotation] ,... %>
I'm going to assume ckedit stuff behaves like all other rails forms helpers
the f. tells the helper what model your dealing with, the first argument to the helper is method to call on the model.
So in your question model, you have to define BOTH a setter and getter
class Question << ActiveRecord::Base
def formatted_question
end
def formatted_question=
end
end
You have to define the setter, either that, or you have to manually delete the params[:question][:formatted_question] from the params hash before you try and create a new question, or update an existing question.
So make formatted_question do what ever you need and return the string you want.
You can leave the setter formatted_question= blank, that's probably easier than deleting params[:question][:formatted_question] from the hash before you create or update a @question instance variable.
Then you can do:
<%= form_for @question do |f| %>
<%= f.cktext_area :formatted_question ,... %>
Last edited by BradHodges (2012-02-08 20:30:22)
Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.