Search Results

Search found 9437 results on 378 pages for 'rails newbie'.

Page 65/378 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • Moving from php to rails

    - by piemesons
    While moving from php to rails (Means procedural language to Object oriented language), what are the various things you should keep in mind. How to think in world of object oriented programming? What are thinks i should kept in mind before starting the things. Any tips?

    Read the article

  • Upload an image from JSON with rails

    - by Dougui
    I have an application created with PhoneGap and Backbone. I upload a file as JSon and my server receive data like this : data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/... I'm trying to write the file like this : File.open("#{Rails.root}/public/images/#{self.id}.jpg", "w+") do |f| f.write(data) end It's not working and I don't know what to do. When I'm trying to open the file I have this message "Not a JPEG file: starts with 0x64 0x61". Do you have a solution?

    Read the article

  • Nested Model/Routes in Rails 3

    - by mbreedlove
    I have a simple blogging functionality in my Rails 3 app. I am trying to add commenting to each post. The BlogComment model has a property, blog_post_id, to be able to find the corresponding comments for each post. I already setup my associations in the model, I also nested BlogComments under BlogPost in the routes file. However, I can't figure out how to give each BlogPost access to its respective comments through the controller so that they can be shown later in the view.

    Read the article

  • Regular Expression Routes in Rails

    - by Kevin Sylvestre
    I am looking to create a rails route that is capable of accepting requests using a regular expression. Specifically, I need optional paths. As an example: "(/first)?(/second)?" Would match: /first /second /first/second But not: /second/first Is this possible? Thanks.

    Read the article

  • Rails find all with association

    - by aaronrussell
    I have what I think is a very simple problem (famous last words)... I have a Category model that has_and_belongs_to_many Events. I want to construct a simple and efficient query that finds all categories that have 1 or more events. (using Rails 3) I'm sure I'm having a dumb moment here - any help appreciated :)

    Read the article

  • Rails cookies not working right

    - by Michael Waxman
    Rails is setting and returning a remember_token cookie like this: = cookies[:remember_token] = value6c69b17681d2bf316f8eexpiresThu Jun 10 14:55:00 -0400 2010 In other words, when I'm calling the cookie I don't just get the value. Why is this? I am setting the cookie as follows: cookies[:remember_token] = { :value => @user.remember_me, :expires => 1.year.from_now} What's going on here?

    Read the article

  • rails script/generate scaffold problem

    - by palecoder
    I'm new to rails and was trying out the scaffold command - the following scaffold runs and works when I view it via web brick script/generate book title:string the following fails - gives me a weird route error script/generate application name:string the following works script/generate app name:string can anyone shed some light on this? Is 'application' a reserved word?

    Read the article

  • Rails and a development domain

    - by Adam
    I'm trying to use http://ls1.bigseapreview.com as a domain for a Rails project. The problem is it doesn't seem to be correctly mapping any routing apart from the home page. I have added /about but you can see that you will just get a 404, but it works locally. What do I have to do to fix this?

    Read the article

  • Rails - before_save that includes updated object

    - by Sam
    I have a before_save that 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 totally 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 it's making things messy.

    Read the article

  • Invalid Active Record Statement Rails 2.3.16

    - by Ranzit
    I am using rails 2.3.16 ruby 1.8.7 For the following line of code I ma getting error as follows: Code: ForeignScheduledItem.find(:all, :conditions => { :foreign_scheduled_item => { :scheduled_items => { :subscription_id => params[:subscription_id] } } }, :joins => :scheduled_item).each { |i| @subscriptions.push(Subscription.find_by_id(i.subscription_id)) } Error: ActiveRecord::StatementInvalid (ActiveRecord::StatementInvalid): Can u please help in this regard.

    Read the article

  • rails named routes + controller as parameter

    - by user350785
    Hi, is it possible to have the controller value in a rails named route as a parameter, which I can pass at runtime to direct the call to the proper controller? e.g. map.ride 'ride' ,:controller = {some-way-of-specifying-a-parameter}, :action = 'ride' then at runtime, I want to pass the controller name to which this call should be going. My actions are doing different things depending to which controller the call gets sent. thanks

    Read the article

  • Removing &NBSP; in Rails

    - by Trip
    I am trying to remove all &nbsp;'s in my model with the following method : def about_us_sans_spaces self.about_us = replace(self.about_us, "&nbsp;", " ") end Except! it turns out 'replace' isn't a method in rails. How would you remove the  s? Mind you, I have already tried sanitized, simple_format. My view looks like this right now: = truncate(sanitize(simple_format(organization.about_us_sans_spaces), :tags => ''), 125).titleize

    Read the article

  • how to use form_tag in rails 2.3

    - by mtay
    Hey all, I'm running into an error using form_tag in Rails 2.3 and can't seem to wrap my head around it. What may I be doing wrong syntactically? =form_tag :action => 'form', :name => "admin_form" #images_actions_bar =submit_tag "Approve", :class => "button", :name => "approve" =submit_tag "Update", :class => "button", :name => "update" I am seeing "syntax error, unexpected kENSURE, expecting $end"

    Read the article

  • Rails: i have a class method and i want to modify something of the instance

    - by Totty
    Rails: i have a class method and i want to modify something of the instance something like this: class Test < Main template :box def test # here I want to access the template name, that is box end end class Main def initialize end def self.template(name) # here I have to save somehow the template name # remember is not an instance. end end that is similar to the model classes: # in the model has_many :projects How do I do it?

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >