I've got lost somewhere along the way with this tutorial (the one at ruby.railstutorial.org), and have an error in my code somewhere. Does anyone have the complete files for the completed application so that I can compare a working version to mine? Thanks!!
you can find the files here on github
Related
Pretty new to the RoR environment and have been trying to incorporate datatables.net into my project located at here
I know where to add the css along with the cdn which is the route I'm taking but the last step for 'Initialising DataTables' and the javascript? that is has there, where would this go in ruby on rails? Spent a lot of time searching google for the answer to get a variety of solutions that didn't work and figured it was time to ask the wonderful experts here.
Finally figured out the problem. Was a simple issue where the scripts where in the body and fixing them into the head section corrected the whole thing.
I am building a Rails plugin for an application at work.
I want to extract logic that was used in multiple locations, but implemented slightly differently, and add new features needed without doing it 2-3 times over.
I've never build a gem, but according to what I was reading it is possible to use rails generate.
However this has not been the case for me.
Running rails g model Something stuff:type:
First interesting thing is that it is generating mini test stuff when I explicitly told the plugin not to use mini test (using Rspec).
Then looking in my folder structure for the plugin, no db/ folder, nothing added to app/models/, and no test/ folder:
Running the command a second time reveals to me that the files are indeed created:
My questions are:
Where is this stuff going? Can I even find out?
Has anyone encountered something similar? Is it due to a misconfiguration, or bug? Essentially, what's happening?
I would truly appreciate any advice or suggestions!
EDIT #1
Forgot to mention that I checked within the spec/dummy application in case things were being created there, and it is still empty as I left it.
EDIT #2
So I found where the files were by using the find command:
And yeah it added the files to my home folder...
At least now I can just paste them in the right location, but obviously this is bizarre and I'd like to get this resolved, figure out what is going on.
Okay so turns out that yes you may use Rails Generators when building a gem. Also, the generated files will not be placed inside the dummy application unless you are in that directory.
Everything is working as expected on a different computer.
That stuff is going into dummy app that is usually located in test/dummy. In your case, it seems to be located in specs/dummy.
Yeap and nope. That's not misconfiguration.
I am trying to implement ajax file upload using Valums file uploader plugin( https://github.com/valums/file-uploader ), paperclip is doing the image processing for me and helping me in cropping it.
I know many you out there would wonder why I am using this config of Rails 2.0.2.. its mainly for project specific purposes..
I am still a newbie with just around 5 months of experience in Rails..
The overall objective I am trying to meet by using this plugin is to get ajax file upload + ajax display working for me.
Firstly I am trying to make sure that the image which is passed as a parameter and the appropriate processing takes place so that the image is saved in the DB.
The main challenge here for me at least is combining Rails(paperclip.. being the major part of it) + Valums file uploader .
With the help of different search queries in Google, I have finally found something that could really help my case:-
This( http://mooooooooooo.wordpress.com/2010/12/03/paperclip-valums%E2%80%99s-file-uploader-and-middleware-continued/ ) is a blog which pretty much does just what I want it to do..
If you can spare some time reading this blog , you would find that the bloggers ("moortens")
approach is to make use of middleware and invoke the same through initializers..
I am pretty sure this blog is written some time after Rails 2.3.x came into existence.. and since I am still a newbie (please bear with me being a novice) and would have to make similar changes for my dev env which is Rails 2.0.2.. I am kinda lost.. figuring out how would I have to call the "raw_file_upload.rb" for me to get things working...
Kindly help me on this..
Thank you very much..
I am creating a simple facebook application using Ruby on rails and I am following the liveRail tutorial available here
http://www.liverail.net/articles/2007/6/29/tutorial-on-developing-a-facebook-platform-application-with-ruby-on-rails
The problem that Im facing is that when I launch my server it throws an error saying that it cant find the 'gem_original_require' : no such file to load facebook_rails_controller_extensions.
I have added the rfacebook gem but the error is thrown when i include the require
require "facebook_rails_controller_extensions" in the environment.rb file.
Im not completely sure whether this is the right way to go with Rails 2 but I've between making changes when i find relevant information for Rails 2
I would appreciate any suggestions on this or any links to other tutorials too.
Thank you
That tutorial is SEVERELY out-of-date and you're going to have lots of issues if you keep following it. rFacebook hasn't be actively maintained in a good 2 years. You should be using Facebooker.
There is a good facebooker tutorial here: http://apps.facebook.com/facebooker_tutorial/
Examine your $LOAD_PATH variable.
It's a common issue that your load path doesn't contain library.
Use $LOAD_PATH<<'/usr/lib/superrubylib' to add a path to load.
Uh, and it seems to be a best practice to use require File.dirname(__FILE__) + "/../relative/path" to set up relative paths.
P.S. Please, specify more data about paths and locations to let us answer your question specifically.
I am testing AlumniOnRails (http://rubyforge.org/frs/?group_id=2959&release_id=17170) which is based on Rails 1.2.6 (I know it's outdated) and managed to get it up, installed the required gems, created and migrated the data and most of the basic alumni functionalities are up but one, the part that is broken seems to be missing a library and yet I can't seem to find it after a few reasonable searches.
The logger shows no such file to load -- collections/sequenced_hash with a line within the controller having the code of require 'collections/sequenced_hash which is quite obvious that the sequence_hash library is missing.
A few searches on Google shows a few references, one with the closest pointer is http://collections.rubyforge.org/classes/SequencedHash.html but unfortuntely the source link is dead. Does anyone keep this kind of old file or point me to somewhere it is? Thank you
Somebody answered this over ruby forum and it works:
gem install collections