-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
36 lines (24 loc) · 1001 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
this Source fork with BBCodeizer(MIT)
easy to use & care Performance , only save or update to process convert bbcode
Just add to Model like
=======Model======
class Post < ActiveRecord::Base
bbcoder :column => "body" , :title => "bb"
end
==================
:column can be Array or String , set column you need BBCode
:title is addon method name , default is "bb"
then add the title in column name with new/edit form
=======View=======
<%= f.text_area :bb_body , :class => "mceEditor" %>
==================
& you can try this :
>> x = Post.first
>> x.bb_body #=> "[u][i]brtb[/i][/u][br]"
>> x.body #=> "<u><em>brtb</em></u><br/>"
>> x.bb_body = "[color=#ff0000]werwer[/color]" #=> "[color=#ff0000]werwer[/color]"
>> x.body #=> "<span style=\"color: #ff0000\">werwer</span>"
& if you using TinyMCE BBCode plugin , you can use %LIB_DIR%/support/TinyMCE/BBCode
to change original plugin to make sure TinyMCE to support all tags & some fix
okay , have fun :P
JokerCatz @ http://railsfun.tw/