similar to: If-Else Conditionals in Views

Displaying 20 results from an estimated 5000 matches similar to: "If-Else Conditionals in Views"

2006 Apr 10
8
Advice on Similar Views with Helpers
I have some embedded tables that form different sections of a view. I find that I use the same look for certain ones which means I have to duplicate the same exact table for each section that''s similar. Is there a way to do.. hmm.. well.. kind of like what a layout does using @content_for_layout, but for a partial. Does that make any sense whatsoever? :) OK so here''s some
2006 Jun 09
8
Installation on OSX...
Hi, Just got my first Mac. I''m trying to install rails on it, using the instructions in the rails wiki: http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTigerUsingDarwinPorts I go to install mysql, and the version of mysql supported by DarwinPorts appears to be 4.1.18. But all the sites appear to only have 4.1.19 or 4.1.20. So it looks like DarwinPorts is over a month out
2008 Oct 01
11
RFE: if/else control flow in probes
Hi all, There''s a dead thread about this back at http://forums.sun.com/thread.jspa?threadID=5075157, but it would be really nice to have support for if/else control flow in actions. Reasons: 1. The ternary operator ?: is already there (though it doesn''t let you do anything with side effects) 2. The user can already write arbitrary and expensive non-cacheable predicates if
2006 Apr 18
2
link_to_function onmousedown
Hi, Is there some way to produce an anchor that looks like the following using helpers, or should I just code it in the rhtml like this? <a href="#" onmousedown="javascript:foo(); return false"> Thanks, Brad -- Bradley Mazurek
2006 Mar 17
2
How to let the layout be more OO?
I am confused about the @content_for_layout.''cause it will display all the views in the layout.Do I have any methods to let the layout be more OO? I mean that for example,the app currently have more than one views to be displayed,but only some of them to be displayed at the same time at different <div></div> units. I hope there exists a kind of way that: <%= if
2006 Apr 07
6
Magic Field Names - "position"
What does the Magic Field Name position do? I was looking here: http://wiki.rubyonrails.com/rails/pages/MagicFieldNames And unfortunately that documentation is incomplete. Thanks. -- Posted via http://www.ruby-forum.com/.
2006 May 24
1
How to marshal Javascript data?
I''m trying to marshal some information I have in Javascript, and send it over an AJAX request to the server, specifically to be stored in a model on the server side. I have some Javascript routines I wrote that gather information about the user selection. I see that the link_to_remote has a :before option in which I can write Javascript to collect what I need, but right now I''m
2006 Apr 04
1
Manipulating has_many :through associations
Hi, I haven''t done any associations before, so please forgive my incorrect use of terminology... If I set up a has_many :through association, can I manipulate the associated instances directly (like an Array), or do I need to manipulate the join model? For example, suppose I have two classes and the associated join model: class foo has_many :foo_bars has_many :bars, :through
2006 Mar 25
4
dynamic set_table_name for achives
How can I pass something to set_table_name so that I can switch tables on the fly for accessing archive data? If I could access sessions inside a model I would do something like: if @session[:current_period] set_table_name "statistics_" + @session[:archive_year] else set_table_name "statistics_" + Date.now.year end But since I cannot access the session from within a
2006 Mar 28
5
combining two models in one controller/view "set"
I''m going to take another stab at this question (my first one received no replies): I have two models: Author has_many: books Book has_one: author I have two tables: authors id ... books id author_id ... I let the scaffolding fly and it created the CRUD goodness for each model, as expected. However, I want to have only one view/controller "set" for both models; when I
2006 May 24
2
PDF Writing without Cached File
I''m researching generating PDF files via RoR. I see there are packages available to do this. One such package is the PDF-Writer. The examples I saw for this package save the PDF to a file. Is there a way I can output the PDF on-the-fly to the browser rather than having a temporary PDF file? I just can''t have these files laying around since they contain sensitive
2011 Feb 15
1
ternary contour plot
Colin, If your propose is to create a ternary plot with points and vectors, I think easier do this with graphics based plots instead of trellis based plots. Although, with little work you can do with trellis too. I gave you a reproducible code to put an arrow in a ternary plot. I use the function locator() to extract coordinates. The code is the following
2003 Jul 15
2
R, geochemistry, ternary diagrams
I'm in e-mail contact with a geochemist who maintains a well regarded geochemistry web site. He's drawing diagrams either with a Turbo Pascal program running in a DOS window or with Excel. I'm trying to persuade him that R would be a better choice. Something he's particularly keen on is ternary diagrams. I think he is talking about ternary phase diagrams, and if so, it looks as
2008 Nov 18
1
How to Barge specific extensions
Hi All Can anybody help me for dial plan to barge or Spy(ExtenSpy) specificor selective extemsions among 20 extension in my office. lets say my office extension range is 301-320 & i want to barge only 3 extension say 320, 302,314. is this possible to barge specific extension? . Plz help me for this.I am using Asterisk 1.4.9 & SIP channels. Regards Amit -------------- next
2013 Nov 19
2
Communicate with barge agent
HI folks, I have set a barging facility with our production box.Client able to barge a agent but client raise a requirement, they want talk to barge agent but that communication is not listen by customer. It is possible with asterisk or not. thanks in advance. Regards Akhilesh -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jan 07
2
Before filter...
I have a before filter in my application.rb, for every action and controller it gets run, except for one action. How can I see whats going on? And why it doesnt get run? Thanks joey__ -- Posted via http://www.ruby-forum.com/.
2009 Sep 29
3
chanspy and DISA
Hello all, OS OpenSuSE 10.3 * ver 1.4.26.2 zaptel ver. 1.12 Digium TE122 I have a request for remote users to be able to dial through the system so that the sales managers can barge/chanspy on the sales force. I have the DISA part working with authentication(rather straight forward) but what I can not figure out is how to enable the supervisors to be able to barge on these calls. Is there a
2006 Mar 31
5
Changing Table Schema and Models
If I make a change to a database table, how do I recreate the model to reflect the change? -- Posted via http://www.ruby-forum.com/.
2006 Apr 03
2
Ternary or Triangular Plots (soil texture triangle plot)?
Hi, I am trying to create a triangular plot to show the 'composition' of a set of items with three variables (historically the percent sand, silt and clay in soil). So far I have tried the 'soil texture triangle plot' in the package plotrix and the 'ternary or triangular plots' in the package cwhtool (cwhmisc). Both have strengths and weaknesses, but neither has a
2001 Mar 19
2
Ternary plots
********************************************************** ** Dr. David Lucy ** ** Centre for Forensic Statistics and Legal Reasoning ** ** Department of Mathematics and Statistics ** ** The University of Edinburgh ** ** James Clerk Maxwell Building ** ** King's Buildings