similar to: Formatting Data in rhtml

Displaying 20 results from an estimated 1100 matches similar to: "Formatting Data in rhtml"

2006 Jan 25
15
Newbie: Static page without controller
Hello, I''ve been through a few tutorials and have made some simple apps that interact with the database, but I''m having trouble doing something that seems like it would be very simple. Just imagine a static website that doesn''t interact with the database. You have pages like: www.domain.com/home www.domain.com/services www.domain.com/more-stuff Since these are
2006 Jan 17
9
Formatting a float with a set number of decimals
Another newbie question: How do i convert a float to a string, rounded to a certain number of decimals? Thanks -- Posted via http://www.ruby-forum.com/.
2006 Jul 23
4
Newbie question about .rhtml
Hi everyone, coming from PHP something in the .rhtml files has been confusing the heck out of me. Why does this work? <% for header in @all_headers %> <%= header.subject %> <% end %> and both of these don''t work <% for header in @all_headers puts header.subject end %> --------------------------------------- <%= for header in @all_headers puts
2006 Aug 18
4
HELP!!!! - number_to_currency in model?
Hi, I''m trying to use number_to_currency in one of my models, but i''m getting the following error: undefined method `number_to_currency'' for #<Product:0x396d680> Obviously, my Product model can''t access number_to_currency -- is there something I need to do to make it available? Thanks so much for your assistance. -- Posted via
2006 Jul 26
7
RHTML in database?
Hi, is it possible to store RHTML templates or partials in database? thanks, Bojan Mihelac -- Bojan Mihelac Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com -> tools, scripts, tricks from our code lab: http://source.mihelac.org
2005 Dec 30
9
cannot load engines plugin/scaffold broke
from C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_suppo rt/dependencies.rb:214:in `require'' from script/plugin:3 I get the above error. Also, I cannot get scaffold to work. I installed ruby182-15 and did a gem rails I am using Windows XP Thanks Frank _______________________________________________ Rails mailing list
2009 Jul 24
7
number_to_currency not working since 2.1.1
Back in 2.1.1 everything was sweet: Loading development environment (Rails 2.3.3) >> include ActionView::Helpers::NumberHelper => Object >> number_to_currency(12.3) >> "$12.30" Then I upgraded to 2.3.2 and: Loading development environment (Rails 2.3.3) >> include ActionView::Helpers::NumberHelper => Object >> number_to_currency(12.3) >> 12.3
2006 Mar 03
1
number_to_currency() helper == non DRY == could be improved
Hi all, Apologies in advance if I got this one wrong, I''m still just a newbie ;-) Going through the Apple ADC RoR tutorial it suddenly occurred to me that the ''number_to_currency()'' helper method was not DRY streamlined. Scenario:: The "number_to_currency()" methods options hash works great when I need to dynamically display different currencies when I
2006 Feb 28
4
number_to_currency UK pounds
I work in the UK and therefore most of my currency figures will be in UK pounds. I realise that to format a number to a currency format I can use: number_to_currency(amt, :unit => "?") but it would be more convenient to set ? as the default currency symbol. What is the best way to do that? Should I edit line 39 of this file:
2006 Apr 08
2
Cannot use view helpers in RJS helpers
Any ideas why I would get an error in a RJS helper on view helpers such as number_to_currency. Example: # my_template.rjs page.help_me # my_helper for my_controller def help_me number_to_currency(10) end I have also tired page.number_to_currency but that doesn''t work either. Cheers, Nicholas
2005 Jul 24
1
international version for number_to_currency ?
bryce benton wrote: > number_to_currency(1234567890.506) => $1,234,567,890.51 BTW agile book does mention this .. will this number_to_currency(x) be internationalized ? or i can set it to Indonesian for example (or to any other languages rather than just English) ? -- Salam hangat, <%= Arie %> | http://blog.riyari.com | Y!: riyari3 email: ariekusumaatmaja_at_riyari_dot_com
2009 Sep 24
2
Calling ActionView from uninheriting class
Hi Gurus, I have a class, specified in models cart.rb, which doesn''t inherit from anything--it''s just a container class Cart ... I just discovered I can''t call number_to_currency in that class. Any idea how to "include" it in my code? I tried ActionView.number_to_currency without luck. I could kill a few lines of non-DRY regexp code in cart.rb if I could
2006 Apr 27
4
how to make views changable
Hello I need to make site views changeable I found how to change layouts but it is not enough, becouse templates can use different ways to display and organize content. I found one way to do this, but i need to make subfolders in my ''view/layouts'', ''view/controller_name'' both and to create additional subfolder somewhere in ''public'' to put
2006 Apr 05
1
number_to_currency inside model
I was wondering if this is possible. I have a model (Item) that contains products. These products have prices that I''d like to format using number_to_currency. Rather than doing this several times inside the view, I thought it might be nice to do it once inside the model. The item table has an field called regular_price which holds a currency amount. I would like to do something
2007 Dec 06
3
number_to_currency
I am using the number to currency function because i live in the uk and the company want me to only show values of the pound of course.I have created all my application using ruby script/generate scaffold_resource.... I have come across with a problem... this code is in my applcation: def number_to_currency(number, options = {}) options = options.stringify_keys precision, unit, separator,
2009 Mar 04
10
total per user
so I am trying to sum month over month the amount that a user has posted. So for example: User 1: Jan $3000 Feb $4000 March $1500, etc. I can get this to work if I sum totals (aggregate of all users) but just not by user. Here is my code in the controller: def index @users = User.find :all, :order => ''name ASC'' @deal_groups = Deal.find(:all).group_by {|t|
2010 Oct 16
3
Doubt with symbols in Rails
I was trying to write a wrapper for number_to_currency to return currency in pounds. I used a helper class to do this. def number_to_pounds(amt) number_to_currency(amt, :unit => "£") end This works fine, but I am trying to understand why I can''t use a symbol to pass the values. I thought symbols were like pointers. (you now know I am a newbie). def
2006 Jan 06
2
How do I reference eagerly loaded Models in the View?
[I hope the repost isnt'' "minded". Following the advice of another thread I''ve changed the subject to a question. If I haven''t included important info, please ask. My database is being unduly killed. Jodi] Cheers on-the-Rails-ers, Before I start, I''ve read the ActiveRecord docs on eager loading, but for the life of me, I can''t seem to get
2008 Feb 05
5
how can my model reference a helper?
I know, I know, they''re not allowed to. But here''s my problem. I''ve got a really simple model with two fields, name and price, which I want to show in a form select drop-down. "collection_select" takes a ''text_method'' parameter, which is the method in the model that gets its value placed in the <option> tag. Because I want to show both
2006 Jul 04
11
Any CMS for Ruby on Rails..
Well i want to make a photography community site on the lines of www.gfxartist.com , www.terminus1525.ca, www.phirebrush.com Where the community votes for every subbmission from a artist and can comment (like a forum).. Now gfxartist has used probably SMARTY,php,and their own CMS. terminus used Drupal,Gallery 2.Some one tells me that this combo is heavy on resources and slows down sites.