Hi,
I have AS working in another app just fine (I dont remember this
issue...) - its also using Rails 2.3.9, on same dev box.
Now trying to add it to a new app and getting this error when running
the webrick, script/server:
/Users/kimptoc/.rvm/gems/ruby-1.8.7-p302/gems/activesupport-2.3.9/lib/
active_support/core_ext/module/aliasing.r...
I have a number of pages in my app that are showing partial FOUCs (flashes of unstyled content) upon loading, which occurs because some of them have stylesheets and/or javascript defined at the head of the document rather than in the layout. The fundamental issue is that the DOM is firing before these stylesheets are loaded.
In order to...
Here's is my permissions controller for DEF UPDATE:
def update
@permission = Permission.where(:user_id=> params[:permission][:user_id] ).where(:project_id=> params[:permission][:project_id]).first
respond_to do |format|
if @permission.update_attributes( params[:role_id] )
format.js { render :layout => false }
else...
In certain situations I run my app in a context like: /context/app , but sometimes I only use: /app
In my DB I have an applications table that has an attribute for the path of the application (ex. /app ), what Im looking is that my app could determine in wich context is running in order to update that attribute (ex. /context/app)
I th...
Say I have an array of strings
arr = ['sandra', 'sam', 'sabrina', 'scott', 'mark', 'melvin']
How would I search this array just like I would an active record object in Rails. For example, the query "sa" would return ['sandra', 'sam', 'sabrina'].
Thanks!
...
Hello. I'm diving into RoR and I need to remove a model and its table, as well as update the other models that reference it. I did a search on google and SO and the best answer I found was this, but the answer is unclear to me. The final consensus was to use the ruby script/destroy model method and then "manually edit any migrations t...
I'm using a simple ajax toggle partial in a view, to allow a user to toggle a message as read vs. unread. When I toggle I get a failure.
MessagesController#show could not find MessageCopy without an ID.
Application trace: messages_controller.rb:21 in 'show' (first line of the action)
show.html.erb
<%= render :partial => "read_unread_...
If I submit a new user form with errors, it redirects to the index page and then renders the new page on top of it. In the controller I specify that it should just render the new action so that the user can see/fix their errors and resubmit. Is there something obvious that I am missing?
Here's the create action in my controller code:
d...
What's the difference between ruby script/destroy model and rails destroy model?
...
I've been converting my Rails 2.3.9 application to Rails 3.0 and everything has been going well. I've created a lot of routes with the new system so I feel like I know how to do this. However, I recently got a routing error I can't solve.
I have a users resource defined like this:
resources :users do
member do
get 'activate'
...
I am trying to deploy my app on Rails for the first time using Heroku.
I have spent quite a lot of time but there's a gap somewhere.
Git: created private repo, pushed to git successfully
Heroku: created free app and pushed successfully (but app 'crashes')
Local:
rake db:schema:dump #success
rake db:schema:load RAILS_ENV=production #...
Hi everyone
Whats the best way to disable additional html generation for date helpers in Rails?
Lets say i have a field on form <%= select_month(...) %> and it generates div class and new span inside. Is there a way to generate just the select html tag?
Of course i can generate the whole tag by myself, but just wanted to know if thats...
Hello. I'm diving into Ruby on Rails and I find that when I'm using the scaffold code that RoR generated for my model, it causes a confirmation box to appear that reads "Are you sure?" when I click on the delete link. What causes this to appear and how do I remove it? Thanks, I'm just trying to figure out how this all works.
...
I have a white-labelled Rails app that allows me to create a variety of different new websites, each with their own TLD, but all powered by the same app. It's an ecommerce app so all orders are processed on a single, different TLD.
For example, I might have three TLDs:
domain_a.com
domain_b.com
domain_c.com
and orders are processed o...
Hi all!
Today I was faced with a challenge to create different behaviors for my shopping cart model. That's because the owner of the online shopping wanted to create some promotions like buy 1, get 5 or get 25% discount + some extra stuff, etc...
I thought of doing it with polymorphic inheritance, where my Cart model will only hold the...
I'm somewhat new to S3. I'm wondering if it's a good idea to put public/images in S3 bucket and if so is there an easy way to do the move?
...
What's the best way to generate Pictures, Pixel by Pixel in Ruby on Rails. I have a two-dimenisonal matrix with all the color values for each pixel, which i want to vizualize.
Something like this:
myBitmap = new Bitmap(:width => Column.all.count, :height => Row.all.count)
Colum.all.each do |col|
Row.all.each do |row|
#Draw the Pixel...
I am trying to create a comment that could comment on other comments but are all derived from a single post.
What is especially troubling for me is trying to figure out how to make it so that this can all be achieved in the post show and not its edit or new. Is this archtecturally reasonable?
That way I can access it via Post.comments,...
I've written a rails site in the latest version of rails, based on knowledge of rails from a couple of years ago, and I've hit a horrible snag.
I foolishly decided to ignore the new RESTful routing system and hope for the best.
So all of my views are plain .erb, NOT html.erb
my routes file looks like this
map.connect '/crm/:action/:i...
Hi, trying to learn ruby on rails at the moment and currently learning about testing. The tutorial I'm following uses rspec, so I ran the commands:
sudo gem install rspec
sudo gem install rspec-rails
script/generate rspec
only to get an error message "Couldn't find 'rspec' generator". I've searched for an answer on this topic but I ca...