similar to: getting the last four digits of a string or number

Displaying 20 results from an estimated 1000 matches similar to: "getting the last four digits of a string or number"

2006 May 09
11
model filter?
Hi All, Is there a way to filter / modify the output of a model class before it''s returned to controller/view that''s calling it? Example: I have a field phone_number which I always want to preformat using the number_to_phone() helper.... Any help is appriciated. Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Aug 14
2
ActionPack: number_to_phone error
Question about the number_to_phone function as provided by rails in actionpack: http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html If I do this in my controller: num = number_to_phone(params[:phone_number]) I get this error: undefined method `number_to_phone'' for #<TicketsController:0xb7a2bfcc> Whereas if I do this in my view: <%
2007 Nov 29
3
Stylistic preferences
What are people''s opinions on which of these two styles is better to use? 1) before --------------------------- module UserSpecHelper include GenericSpecHelper def valid_sms_attributes(phone_number="12345") { :phone_number => phone_number } end end describe User, "with phone number" do include UserSpecHelper before(:each) do @user =
2007 Feb 23
2
how to remove spaces from phone number
Hi, I need to allow login based on the phone number. During the signup they can give the number in any format with spaces, slash or (). But for storing in database and then during login to compare I just want the 10 digit number. How can I remove the special char from phone number before storing to db ? Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Feb 15
6
error_messages_for trouble
I am trying so learn how to do custom validations. The validation works as expected, but I can''t get "error_messages_for" to display. How is the name of the object supposed to be formated? Where is this object created, the model or controller? What am I doing wrong here? #### Model ######################## class MyFolder < ActiveRecord::Base def validate # validation
2008 Nov 04
3
Nester Resources, Routes and Class Inheritance
Ok here''s a quicky... but a goody :) We have models Company, Reference and Applicant... and References and Applicants just inherit from Company, and are basically companies with the type field set to reference... All companies can have a phone number associated with them, and phone number is a different model... I''m having trouble using the form_for method with a company that
2005 Mar 10
1
Asterisk@Home, AMP, and Broadvoice
Egad, not again with Broadvoice! Anyhow, I recently installed AAH and configured my TDM11B and got that and some SIP phones working. I still have some issues to work out, etc, but my current problem is Broadvoice. I have checked out all of the online resources, including the recent list exchange about the recent changes made by Broadvoice. However, the one thing I have found to be consitent in
2006 Aug 10
6
Getting started w/ Ruby on Rails
Hi, I would like to get started with RoR, since it seems to be a terriffic platform for Webdevelopment. However, I''m unsure what "level" you need to be on in terms of programming to get started? Best regards, Gustav -- Posted via http://www.ruby-forum.com/.
2015 Sep 21
3
New software based on libvirt
Hello, I'm introducing to you the decentralized cloud Cherrypop. Combining libvirt and LizardFS (as of now) it becomes a cloud completely without masters. Thus, any node is sufficient for the cloud to be up and therefore no wasted resources and no single point of failure. It's still pretty crude software but will work with some tinkering. Hope you try it and like it! For more
2006 Apr 14
7
How to call a java function in rubyonrails method
Hi everyone, I''m Italian and sorry for my english mistakes... I''m developing a web-site using rubyonrails. It''s REALLY COOL! But I''m obliged to re-use some javascript functions. Do you know where I can get the right documentation (and examples) in order to integrate these two different environments? Thanks, Matteo. -- Posted via http://www.ruby-forum.com/.
2006 May 24
1
does select support arrays in a form with multiple models?
i have a one-to-many model (an addressbook of contacts with many phone numbers). i want to represent a select element so that its name is an array containing the phone_number id... <select id="phone_number_1_location_or_kind" name="phone_number[1][location_or_kind]"> <option value="Work">Work</option> <option
2006 Jul 28
2
Delete has_many_and_belongs_to_many relation
Hi there, Just a simple question I guess, but I am unable to find an anwser... How to delete a hmabtm relation? Any help will be appreciated :) Thanks, Fabrice. -- Posted via http://www.ruby-forum.com/.
2013 Feb 17
3
Select components of a list
Hi Gustav, Try this: lapply(1:length(models),function(i) lapply(models[[i]],function(x) summary(x)$coef[2,]))[[1]] #1st list component [[1]] #??? Estimate?? Std. Error????? z value???? Pr(>|z|) # pm10 #5.999185e-04 1.486195e-04 4.036606e+00 5.423004e-05 #[[2]] #??? Estimate?? Std. Error????? z value???? Pr(>|z|) #ozone #0.0010117294 0.0003792739 2.6675428048 0.0076408155 #[[3]] #???
2006 Oct 20
7
MVC and modules. Views telling models to behave
I was thinking today, it would be nice if a view could tell a model how to format it''s data for that particular view. Kind of like, the view is bestowing instant, and temporary knowledge on the model for the duration of the views run. It seemed to me that this would be more objecty than say a helper that formats a string format_my_string( my_string ) Instead, in my view. Lets assume I
2006 Aug 12
5
In place editing on a list - not passing ID through
I want to do in-place edits on a list of data, but I''m having trouble getting the ID passed through to the controller. I use this in my view to create the field: <% for frame in @frames %> ... <%= in_place_editor_field :frame, :price %> <% end %> and this produces the following in my output: <span class="in_place_editor_field"
2007 Jun 24
6
I only want one type of model returned from a multi_search
I am trying to use acts_as_ferret''s multi_search to search across multiple models, but i only want it to return one type of model. for example i have a page that lists out people. on this page it shows email addresses and phone numbers. I want to be able to search by any fields directly from the person model and search the fields from the email_address and phone_number models, but I only
2006 Jun 09
2
php within public
I''m working on integrating tiny_mce with rails, which has been very successful so far. I want to use the imagemanger and filemanager plugins for image uploads directly through the editor toolbar, which are php scripts. My first attempt was to modify the .htaccess to prevent apache from routing the requests to rails. Here''s what i''ve got in my htaccess:
2006 Jul 31
2
ambiguous column name in has_many :through
In my application model I have three classes: Accounts, Projects, and Items class Accounts < ActiveRecord::Base has_many :items, :through => :projects, :source => :items has_many :late_items, :class_name => ''Item'', :through => :projects, :conditions => [''due_on < ?'', Time.now], :source => :items end class Projects <
2006 Mar 14
3
Check whether externam URL is valid?
Hey, I have users entering URLs into my app, is there anyway in which I can check to see if the URLs actually point to something before saving the user input? Maybe a kind of ''ping''-action that returns true on success? (btw: does anyone of a tentative release date for Rails1.1? I''ve been slobbering all over my RailsRecipes book and I can''t wait! Also, Scott
2019 Jan 13
2
Samba 4 users - UID/GID - or how to migrate
Hello, I try to migrate my old SAMBA Installation to a new Installation. SAMBA is running. But my Windows users can see the shares but cannot open Files. My old Installation /etc/samba/smb.con ...        workgroup = DUCK         server string = %h server (Samba, Ubuntu)         interfaces = eth0 192.168.1.200/255.255.255.0 localhost         bind interfaces only = Yes         security =