Displaying 7 results from an estimated 7 matches for "yes_no".
2006 Jun 26
5
using application_helper.rb
I have a simple Yes/No selection list that I am using in a number of
places. Thinking that I could DRY things out a bit, I added it to
application_helper.rb ...
YES_NO = [
[ "Yes", true ],
[ "No", false ]
].freeze
So I figured I would use it there instead of in each model.rb where
needed.
anyway, in webrick screen, I am continually seeing this...
script/../config/../app/helpers/application_helper.rb:6: warning:
already initialize...
2006 Mar 10
6
boolean select problem
I want to use select form elements to choose between boolean options. How
can I have it default to true and still display the persisted value (either
true or false) when editing an existing object? I guess booleans default to
false by default so its not obvious how to recognize when it''s a real
''false'' that the user set or default false because the value was null.
2006 Mar 01
4
another select_list question - bad bad booleans
I have a select list for a boolean column in postgresql
in the ''model'' ...
YES_NO = [
[ "Yes", "1" ],
[ "No", "0" ]
].freeze
in the ''view code'' ...
<%= options = [[''Accepted?'', '''']] + Placement::YES_NO
select("placement", "accepted", options)...
2007 Mar 23
0
[918] branches/wxruby2/wxwidgets_282/samples/aui/aui.rb: Fix a couple of little bugs and typos
...x"> if event.get_pane.get_name == "test10"
</span><span class="cx"> msg = "Are you sure you want to close/hide this pane?"
</span><span class="cx"> dlg = Wx::MessageDialog.new(self, msg, "Wx::AUI", Wx::YES_NO)
</span><del>- if dlg.show_modal !- Wx::YES
</del><ins>+ if dlg.show_modal != Wx::ID_YES
</ins><span class="cx"> return event.veto
</span><span class="cx"> end
</span><span class="cx">...
2007 Mar 22
0
[916] branches/wxruby2/wxwidgets_282: More Wx::AUI classes, event hooks and sample
...tebookArtSimple
+ event.check(@notebook_style == 1)
+ end
+ end
+
+ def on_pane_close(event)
+ if event.get_pane.get_name == "test10"
+ msg = "Are you sure you want to close/hide this pane?"
+ dlg = Wx::MessageDialog.new(self, msg, "Wx::AUI", Wx::YES_NO)
+ if dlg.show_modal !- Wx::YES
+ return event.veto
+ end
+ end
+ end
+
+
+ def on_create_perspective
+ msg = "Enter a name for the new perspective:"
+ dlg = Wx::TextEntryDialog.new(self, msg, "Wx::AUI Test")
+ dlg.set_value("Perspective %d&qu...
2006 Nov 13
7
[736] trunk/wxruby2/samples/dialogs/dialogs.rb: Fixed crashing bug in on_paint and made the code style more Ruby like.
...gt;
</span><span class="cx"> dialog = MessageDialog.new(nil, "This is a message box\nA long, long string to test out the message box properly",
</span><span class="cx"> "Message box text", NO_DEFAULT|YES_NO|CANCEL|ICON_INFORMATION)
</span><span class="lines">@@ -284,7 +283,7 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx">
</span><del>- def onNumericEntry(event)
<...
2005 Aug 15
16
swig_up
Tracing down some things to add in validators and I''ve run across
something that kinda bothers me...
In order to implement validators you have to override the clone method.
The directors seems to be set up to specifically handle this situation.
However, whenever C++ calls back to the object''s methods the swig_get_up
function is returning false. It seems like swig_up