similar to: Modify beginning_of_week?

Displaying 20 results from an estimated 70000 matches similar to: "Modify beginning_of_week?"

2009 Feb 17
3
Dynamic select box
Hi everyone, I have a problem. I want to display a different select box wether the current user is an admin or an user. So I thought I could do this in my view where my form is displayed : <p class="form-input"> <%= f.label(:role_id, ''Role:'') %> <% if (current_user.admin?) then collection_select(:user, :role_id, Role.find(:all, :order =>
2006 Oct 24
13
How can my boss take rails seriously with bugs like this?
The Time::next_week method is supposed to give the time of the start of the next week. But look at this, it cocks up : >> t=Time.parse "Monday October 16th 2006" => Mon Oct 16 00:00:00 BST 2006 >> t.next_week => Mon Oct 23 00:00:00 BST 2006 >> t.next_week.next_week => Tue Oct 24 00:00:00 BST 2006 >> t.next_week.next_week.next_week => Mon Oct 30
2009 Jun 07
17
ActiveRecord Classes
I''m having a little trouble with understanding how to work out the schematic for some of my classes using ActiveRecord when a file is in my lib directory: Brief example: Here''s the outline of the files in use: ....app ........controllers ............application_controller.rb ............rushing_offenses_controller.rb ........models ............rushing_offense.rb ....lib
2006 Jun 04
8
hashed password, send reminder email...impossible?
Is it possible to somehow send an email containing the user password if it is stored as a md5 hash in the database? Is it stupid to save the passwords as clear text strings in the db? Its a web shop. A workaround would be to generate a new password and send it to the user. If the user then want to, he may change to another password. Any other thoughts on this? //D -- Posted via
2008 Nov 21
5
Getting the number of years between two dates
Hey, I need to get the number of years (as a number) between two dates. Here is what I have as a helper. # Returns the number of years between now and the specified date. def years_ago(date) dateDifference = DateTime.now - date results =Date.day_fraction_to_time(dateDifference) return results[0] / 24 / 365; end I''m sure there is a better way to do this. What is it?
2013 Jun 27
2
Date.weekend?
Hello, Having a boolean *.weekend?* on the Date class would be a good feature. It will basically do this: saturday? || sunday? Makes the code cleaner and easier to read. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to
2008 Nov 13
4
Howto make a 2.6.26 kernel for my domUs
Hello, I wants to make a self compiled kernel for my domUs on a debian etch server with Xen 3.1.4 and 2.6.18.8 dom0 kernel. So, I download sources for linux-2.6.26.8, and I enabled all the Xen features : Symbol: HVC_XEN [=y] Symbol: XEN_BALLOON [=y] Symbol: XEN_FBDEV_FRONTEND [=y] Symbol: XEN_SCRUB_PAGES [=y] Symbol: XEN_KBDDEV_FRONTEND [=y] Symbol: XEN_BLKDEV_FRONTEND [=y] Symbol:
2009 Apr 19
15
Not quite a rails question but can anyone advise?
Hey guys! I''m having a little trouble trying to integrate RMagick with my rails app. In the online terminal (on my host''s server) if I write: export "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" before opening the rails console then I can require "RMagick" no problem. Without adding usr/local/lib to the LD_LIBRARY_PATH I get the error message described
2008 Nov 30
12
How to go back to using webrick default server
Hi, I''ve installed mongrel to check it out and want to go back to using webrick as default when i type server/script to run my server. How can I do this? I know that I can just type server/script webrick but i''d prefer to have it as default. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2008 Jul 10
7
Showing another controllers action
If I am in controller A and I want to show the index of controller B, how would I do that? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2008 Nov 13
5
Touch an ActiveRecord - timestamps
When I update an ActiveRecord, i would like to "touch" one of the related objects, that the updated record belongs_to, in order to update the timestamps on the parent record, although i don''t want to change any of the data in the parent. Whats the accepted way to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2008 Dec 28
7
2.2.2 simple_captcha upgrade error
So thanks to Craig, i got up and running on rails 2.2.2, though now i''m dealing with a whole new can of worms. I''ve done a good bit o searching and haven''t found any solid leads. I''m using the simple_captcha plugin on my site, and all is well until i call that plugin. http://www.pastie.org/347721 ActionView::TemplateError (undefined method
2008 Feb 07
11
Multiple Views within subfolders
Hi, I am creating an application in which I am allowing users to have customized views of a form. These forms do not have to be customized at this point by the user, but will for now be customized by us, and uploaded to the server. My idea was to take the similar approach done by the plug in acts_as_attachment, and, have a default layout stored in the normal views/controller_name folder, but
2009 Jan 31
9
Maxima and Ruby Integration
I''m looking to write a javascript heavy clientside program with a something serverside backend that connects to the free maxima math program. I have extensive knowledge of ruby on rails, so I would prefer to call Maxima with ruby, but I don''t know if this is even possible. Its fairly easy to call Maxima (with a lisp implementation) using ANSI C, it is a little less easy to
2007 Mar 18
8
no route found to match "/cookbook/recipe/list" with {:method=>:get}
Hi, I ve just spent about three hours trying to figure this out, so any help would be appreciated. I ve followed these steps: 1. Downloaded Instant Rails 2. Unzipped it 3. Ran "InstantRails.exe" to configure it. (path is c:\InstantRails) 4. Went to the "Manage Rails Applications" area and chose "cookbook" app. 5. Clicked on "Start with Mongrel" 6. Mongrel
2011 May 25
2
Pdbedit cannot modify SID
Hi, I'm trying to migrate from a SME server to an Ubuntu 10.04 Domain names are the same (domain SID already retrieved) example User john on SME server has SID S-1-5-21-1222067456-3914006320-3959678504-11026 User john on Ubuntu server has SID S-1-5-21-1222067456-3914006320-3959678504-3010 Not to loose Windows profiles, I'm trying to modify john's SID on Ubuntu server : pdbedit -u
2008 May 23
3
Problem with .to_xml and Hash.form_xml ?
Hi, i m trying to do some kind of database dump using .to_xml and after i try to fill my database back (well an other) with the content of the xml. Right now i m doing that : @xml = Video.find(:all).to_xml(:include=>[:vlogiciels]) it does produce : <videos> <video> <mycolumns> ..... <vlogiciels> <logiciel>
2008 Apr 19
4
Displaying external url's
I am a rails beginner and I am having trouble displaying external urls on view. This is what i have in DB for ex: www.rubyonrails.com, if i try to construct the url on the page using link_to the url formed is - http://localhost:3000/www.rubyonrails.com. Can someone help me in fixing this issue. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you
2009 Apr 03
7
RJS not rendering correctly when mime-type is 'iphone'
I have an iPhone version of my site, and for some reason none of the rjs works when viewing the iPhone version. This happens instead: ActionView::MissingTemplate (Missing template controller_name/ update.erb in view path app/views) The rjs works fine when viewing the site normally, and it worked when viewing the iPhone version prior to upgrading Rails to 2.3.2. Additional info: I have
2008 Apr 25
6
ActionMailer
Hi all, I need a help. I have got a user registration form, where the user signs up and then an activation link is sent to the user email id for activating his/her account. Now I need to send an another email to the user, only after he logs in for the first time in my site, then the second email should be sent. Can anybody give me some suggestion on how to do it ?? NB: When the user clicks on