search for: animikii

Displaying 12 results from an estimated 12 matches for "animikii".

2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
I just switched from using the standard "id" column into using my own primary key and generating my own unique id for each record. But, this breaks acts_as_tree. Because my new primary key is not an integer, it breaks the SQL query as follows: StatementInvalid in PagesController#create --------------------------------------------------------------------------------------
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
In console, I am trying to create a User but the :account_id does not come in. Console just gives me back :account_id => nil. Obviously I''m trying to set it though. Silly console... But, I can set the account_id column in my controller like so: @user = User.new(params[:user]) @user.account_id = account.id @user.save Here''s what I give to the controller: User.create :name
2006 Jun 02
6
Set instance variable for all actions in the Controller
Can I set an application wide instance variable that is available for all actions...and their views? eg. class ApplicationController < ActionController::Base @current_user = User.find(session[:user_id]) end and everywhere I can call @current_user.id and I can get that object? Even down in the views? I could not get this to work... Thanks in advance, Jeff -------------- next part
2006 May 29
3
File.size() on Uploaded Images Fail
I am checking the file size of an uploaded file and storing it in a filesize column. It will work just fine when the user uploads any files other than images (jpg,png,gif). Word, Excel, Powerpoint, .zip and more all work fine. This is my model asset.rb that handles the file upload. def newfile=(newfile_field) self.filename = base_part_of(newfile_field.original_filename) self.filetype
2006 Jun 01
2
Migrating Data from Many Databases to One
I had some concerns about breaking Rails table relationships (:has_many, :has_and_belongs_to_many, :belongs_to, :acts_as_*, etc) when moving multiple databases (using the same application) into one. I seem to be stuck when trying to wrap my head around a good database design for what I would like to do or if I am just completely not thinking straight. I guess this isn''t related
2006 May 29
7
re-coding a sizable PHP app in rails
Hello, I am the developer of a fairly major PHP app. It has the full compliment of web application goodies -- email, batch processes, cc transactions, multi-level authentication, security, content management, curl-type interaction with other applications, etc. I am obsessed with the idea of re-doing a year and a half of work in Rails and the more I learn the worse my itch gets. I feel
2006 Jun 13
0
Yet Another Apache/FastCgi Setup Issue
I have set up FastCGI on the server and added 2 servers/processes and increased the timeout from 30seconds to 60seconds. I _think_ I did that properly because I now have to wait the full 60 seconds like clockwork until I get the "Rails application failed to start" when I browse to my URL. Before it was 30 seconds like clockwork. When I run "ruby dispatch.fcgi" I get the
2006 May 29
2
Convert bytes to kb or mb in words
Using File.size(myfile) I can get the size of the uploaded file in _bytes_. Does anybody know of a function to convert bytes into a more human readable format? If I had a wish list for a "file_size_in_words()" function, it would do this: 10752 bytes becomes "10.5 Kilobytes". 2213814 bytes becomes "2.1 Megabytes". 238 bytes becomes "Less Than 1 Kilobyte".
2006 May 31
4
Add 2 Records with Migrations. No errors. No new records.
I have created the following migrationg by using: "ruby script/generate migration AddFirst" But when I run: "rake migrate" it doesn''t add these two records. I don''t get any errors. The schema_info table is created and schema.rb is updated with ":version => 1". Can I not create records this way? When I load up script/console and put in the same
2006 May 10
3
Action Variables Not Available In The View For A Specific Action
I am setting an action variable in my PagesController such as: def manage render(:layout => "admin") @strOut = "STRING Variable Set From The MANAGE Action!" end And in the /views/pages/manage.rhtml view, I don?t have access to that @strOut variable by trying to call it as: <%= @strOut %> However, I am setting the same variable in another action in the controller
2006 Jun 08
2
counter_cache is not looking for children_count with acts_as_tree
Hi there, the acts_as_tree API says that I can set a counter cache and that it will automatically increment the "children_count" column. I did that but when I create a new page it asks for a "pages_count" column instead. Here is the relevant part of page.rb model: class Page < ActiveRecord::Base acts_as_tree :order => :position, :counter_cache => true
2006 Jun 17
2
URL based on acts_as_tree using routes
Hi There! I''d like some feedback before I try to implement some funky rails routes based on an acts_as_tree model. I have a Page model that acts_as_tree. I''d like the URLs to look something like this: http://localhost/about-us/staff/jeff or, another example... http://localhost/what-we-do/products/our-great-cms/features/faqs/ So, as many sub-nodes the user creates,