modal using prototype in rails
How to open an iframe modalbox in a rails app using the prototype javascript library? ...
How to open an iframe modalbox in a rails app using the prototype javascript library? ...
I have a class Post I want the default URL of each posts to be http://domain.com/9383 instead of http://domain.com/posts/9383 I tried to fix it in the routes. I manage to accept domain.com/222 but if I use <%= url_for(@posts) %> I still get domain.com/posts/222 How can I do it? Thank you ...
Yes, I've read this. This is what I'm getting in my production.log: ActionView::TemplateError (undefined method `password' for #<User:0x2b0ddb58cdc0>) on line #11 of app/views/users/new.html.erb: 8: </p> 9: <p> 10: <%= f.label :password, "Password:" %><br /> 11: <%= f.password_field :password %> 12: ...
I was asked this question, "How do you see Object Orientation in terms of rails?". What would be a perfect answer for this in an interview? ...
I'm using the following to populate a series of markers on a Google map in Rails: marker = GMarker.new(coords, :icon => home, :title => "home", :info_window => "Info Text Goes Here" ) I'm trying to customize the info window beyond the text and trying to pass a lot of info into it, but I'm not sure exactly how to do it beyond making a ...
Maybe I'm missing something simple here, but when I run "ruby script/server", I can access it through localhost, but not remotely. Is there something simple I can do to access it remotely without doing some fancy deployment? ...
for example, I have a table 'post' and column 'views'. When people view the post each time, the 'views' will be added 1. Now my step is @post = Post.find_by_id(params[:id]) @post.views += 1 @post.save Is there any better way to add 'views'? ...
I have a shopping Cart that contains many cart item and price or the order. It remember the users choose in the cart, but does not store into database yet. What should I do to store these records. Cart have many cart item. One cart item contain the number of product, and the product obj. ...
I have a table called "order" which has many "order_items" , each "order_items" is belongs_to "order" and "product". In the db, I have one record in order. the record is like this: orders table: id = 1 name= customer and the order_items table is like this: id=1 product_id=233 order_id =1 id=2 product_id=454 order_id =1 I am trying ...
Reinstalling a Rails app on a new server. Part of the app can fork in one of two directions based on the button the user selects. This part isn't working, and when I look at the log I see the values that I gave the form, execept for the commit portion of the params hash. This seems to be why the app isn't working as expected (since th...
How can I suppress the generation of the seconds tag when using the datetime_select helper? I tried using the option :include_seconds => false (used in the time_select helper) but It doesn't work. ...
I want to create the ability for a User to go to a form and put a first name and email address and send an invitation via email. When the recipient clicks on the included link and registers, the Recipient and User are now "friends." Is there a good tutorial to get me started on this? ...
Hi, I'm still trying to make this work. Previously, ever since I tried to send an email I used to see a "Email sent" log in the Output window, but after I followed some steps on the web, setting up a smtp_tls.rb file at initializers folder, everything went wrong. Now I don't even see that "email sent" log, and once I delete that file I...
Why this is not working? link_to_function "share", "slide-build(#{@idea.id.to_s})", :class => "share" in my application.js function share_build(aa) { Effect.SlideDown("s_" + aa); } I used to have the javascript inside a helper in rails, and worked: link_to_function ("share", nil , :class => "share") do |page| page.visual_eff...
I'm trying send flash messages and welcome notices to users if it's their first time commenting; basically, something like this: class CommentObserver < ActiveRecord::Observer def after_save(comment) if comment.user.new? Mailer.deliver_welcome_package(comment) flash[:notice] = "Welcome! We just delivered a we...
I want to create a Ruby on Rails layout and it should be in Liquid format. Basically what I'm trying to do is to let the users to create their own layouts and save them in the database. I tried to use <%= Liquid::Template.parse(<code from database>).render %> in my layout.erb file but there I can't use the 'yield' command (since this ...
Is there a standard or conventional system for organizing multi-file Ruby programs? I have embarked on my first large "project" in Ruby, a search program which is logically organized into multiple files and directories. I've outlined below my potential structure: The main file. This file implements the search class and general searchin...
With capistrano, I am deploying a Rails application from Mac OS X 10.5 to CentOS 5.2 Note that deploy.rb and the server environment have not changed in over a year. There is a task within our deploy.rb file called upload: put(File.read( file ),"#{shared_path}/#{filename}", :via => :scp) This fails each and every time with the follow...
I'm creating a library-style system in Ruby on Rails, and I'm trying to come up with a way to calculate the overdue days while excluding weekends when a borrowed item is returned. Right now I'm just calculating "dayslate" as the difference between the due date and the date the item was actually returned, but I want to exclude weekends, ...
I've got a typical Authlogic setup that I need to enhance to require Customer ID in addition to Login and Password. I've read a bit about using a custom find method and another about using a global variable for accessing the additional parameter and a third referring to documentation about using scopes that doesn't seem to exist. Seems...