Search Results

Search found 10455 results on 419 pages for 'ruby on rails 3 2'.

Page 155/419 | < Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >

  • :confirm option in Rails being ignored.

    - by peehskcalba
    I've got a table of projects in my Rails app, each with a delete link, like so: <%= link_to "Delete", project, :confirm => "Are you sure?", :method => :delete %> However, the delete request is sent even if the user clicks "Cancel" on the dialog box. Any ideas on how to fix this?

    Read the article

  • Problem with Devise authentication on Rails

    - by Jiang
    Hi all, I tried to use Devise 1.0.6 over Rails 2.3. I followed the installation instructions and the user can successfully sign up. However, when I use the registered user account to sign in, the password field is cleared up and nothing happened. Could anyone give me some ideas? Thanks in advance.

    Read the article

  • Session management in Rails (2.3)

    - by JussiR
    Apparently, after upgrading to Rails 2.3 my session storage has stopped working. I used to have this: session :session_expires = 3.years.from_now in my application_controller.rb, but now every time i close the browser (chrome) the session expires. I read from somewhere that session_expires would have changed to expire_after, but session :expire_after = 3.years.from_now didn't do any good eihter.

    Read the article

  • even small file upload stops activity on apache/rails

    - by Pavel K.
    on my rails(2.3.5) app(currently 50-70rpm, maximum response time around 0.7s), uploading even 700k file(using paperclip plugin) locks up the server for web requests for everyone for 2 minutes! (other apps on same server work normally) does anyone have a clue why that might be happening? i am using some mysql transactions which lock the database also if that might be an issue i read http://www.therailsway.com/2009/4/23/uploading-files but it couldn't be locking server for 2 minutes for a small file, could it?!

    Read the article

  • authlogic rails question - how to code for an API

    - by phil swenson
    I have authlogic going on my app, but now I need to have an an API. I don't want to establish a session, just want a user to send in data in a json request such as: {"type":"address","password":"mypassword","name":"my notificaiton name goes here","user":"myusername","text":"my interesting stuff goes here"} So questions - 1) is this a decent approach? 2) how do i do the auth inside my rails controller?

    Read the article

  • rails 3 how to automatically post user_id in column of comments

    - by user568502
    hi, im totally new to rails. here my question: i made an app with articles and comments and use devise for authentication sadly im only able to post 1 hyperlink so this is the middle part of my post with the files at gist: https://gist.github.com/771366 the article_id is pre selected in the comments/_form - but the user_id isnt. i googled a lot, tried value = session[:user_id] and others, but nothing worked would be great if someone could tell me how it works ^^ thx

    Read the article

  • Model self referential collections in Rails

    - by Najitaka
    I have written an application for an online clothing store in Rails 2.3.5. I want to show related Products when a customer views the Product Detail page. For example, if the customer views the detail page for a suit, I'd like to display the accessory products that match the dress such as a vest, shoes, and belt. I have named the related products an Ensemble. However, the vest, shoes, and belts are also Products which is what has me struggling. I have it working as follows but I know it's not the Rails way. I have a Products table for all of the products. Not important here but I also have a ProductDetails table. I have an Ensembles table that has the following columns: product_id - the main or origination product, the one displayed on the detail page outfit_id - the related or accessory product In setting up the data, on the Products list, for each Product I have an Ensemble link. This link takes you to the index action in the Ensembles controller. Using the id from the "main" Product, I find all of the associated Ensemble rows by product_id or I create a new ensemble and assign the id from the main product as the product_id. I'd like to just be able to do @product.related_products to get an Ensemble collection. Also on the index page I list the columns of the main product so the user can be sure their main product was the one they selected from the list. I also have a select list of the other products, with an Add to Ensemble action. Finally on the same index page, I have a table that displays the products that are already in the ensemble and in that list each row has a destroy link to remove a particular product from the ensemble. It would be nice if given a single Ensemble row @ensemble I could do @ensemble.product to get the Product related to the outfit_id of the ensemble row. I've got it working without associations but I have to run queries in the controller to build my own @product, @ensemble, and @ensembles collections. Also the only way I found to destroy an ensemble row is by Ensemble.connection.delete(sql to delete), simple @ensemble.destroy doesn't work. Anyone know how I would set up the associations or have a link to a site explaining a similar setup. None of the examples I found use the same table. They have A related to B through C. I want A related to other A through B.

    Read the article

  • Best way to interact with facebook from a Rails Application

    - by ricardohead
    What I want to do is automatically post to facebook when a user post something on his profile (inside my app), I want to remember the user facebook credential to post automatically without asking for his credentials again. Tumblr has already implement this functionality and I want to emulate it. What is the best way to implement this functionality whitin a rails app?

    Read the article

  • Custom Content-Type for File in Rails 'public' Folder

    - by Kevin Sylvestre
    For assets stored in the 'public' folder of a ruby-on-rails application is it possible to change the 'Content-Type' when running 'script/server'? For example, I am attempting to create an HTML5 application supporting offline mode, and have an 'offline.manifest'. When I run: curl -I localhost:3000/offline.mainfest The following header information is returned: HTTP/1.1 200 OK ... Content-Type: text/plain ... However, HTML5 specifications require: HTTP/1.1 200 OK ... Content-Type: text/cache-manifest ...

    Read the article

  • Expire models in Rails

    - by Koning Baard XIV
    I'm creating a simple paste-bin in Ruby on Rails, which will have an expire-feature. With this, people can select a date when the paste will be deleted automatically. How can I implement this? I was thinking of a cronjob, but maybe there is a more platform-independent way, by defining this in the model itself. Can anyone help me? Thanks.

    Read the article

  • Rails - before_filter than includes updated object

    - by Sam
    I have a before filter than calculates a percentage that needs to include the object that is being updated. Is there a one liner in rails that takes care of this? for example and this is totaly made up: Object.find(:all, :include = :updated_object) Currently I'm sending the object that is getting updated to the definition that calculates the percentage and that works but its making things messy.

    Read the article

  • SMS using Rails in India

    - by Salil
    Is it possible to send SMS in india using rails applcations? If so, can you provide an example? I checked for the clickatell but I think it works only in Australia or the UK.

    Read the article

  • Changing default REST routes in Rails 3

    - by Vincent
    I need to add one parameter to the default REST route for the show action for SEO purposes: resources :neighborhoods, :only => [:index, :show] neighborhood_url(neighborhood) # => /neighborhoods/lower-east-side I want something like the following: neighborhood_url(city, neighborhood) # => /neighborhoods/manhattan/lower-east-side What would be the easiest way to do this without using nested routes and without breaking Rails REST conventions?

    Read the article

  • How to disable activerecord cache logging in rails

    - by user1508459
    I'm trying to disable logging of caching in production. Have succeeded in getting SQL to stop logging queries, but no luck with caching log entries. Example line in production log: CACHE (0.0ms) SELECT merchants.* FROM merchants WHERE merchants.id = 1 LIMIT 1 I do not want to disable all logging, since I want logger.debug statements to show up in the production log. Using rails 3.2.1 with Mysql and Apache. Any suggestions?

    Read the article

  • Need help to understand :source option of has_one/has_many through of Rails

    - by Tri Vuong
    Hi Please help me in understanding the :source option of has_one/has_many through association. The Rails api explanation makes very little sense to me "Specifies the source association name used by has_many :through queries. Only use it if the name cannot be inferred from the association. has_many :subscribers, :through = :subscriptions will look for either :subscribers or :subscriber on Subscription, unless a :source is given. " Thanks.

    Read the article

  • Rails SQL injection?

    - by yuval
    In Rails, when I want to find by a user given value and avoid SQL injection (escape apostrophes and the like) I can do something like this: Post.all(:conditions => ['title = ?', params[:title]]) I know that an unsafe way of doing this (possible SQL injection) is this: Post.all(:conditions => "title = #{params[:title]}") My question is, does the following method prevent SQL injection or not? Post.all(:conditions => {:title => params[:title]})

    Read the article

< Previous Page | 151 152 153 154 155 156 157 158 159 160 161 162  | Next Page >