Jason Hsu, Rubyist wrote in post #1175704:
Also, that link you cited revolves around RSpec instead of Minitest.
I'm using Test::Unit instead of RSpec. and the code of warden test mode
works.
include Warden::Test::Helpers
Warden.test_mode!
--
Posted via http://www.ruby-forum.com/.
--
Hello Jason,
I think need to change some code. You need to test sections of your app
independently, so if you want to check if the view is only available for
Admins, you can login it with test methods provided by Devise and
later, visit the admins_path.
Instead of call login_admin, you can use:
Hi,
thanks for your help. Yes, I did bundle install.
Anyway, now it's solved. On my gemfile, i wrote require 'net/ping'
after the gem 'net-ping', '~ 1.7.1' entry, so now it's:
gem 'net-ping', '~ 1.7.1'
require 'net/ping'
With this, now it's working...
Thx!!
--
Posted via
Hi,
i'm developing a application using Rails 4. In my model I have a method
where i make a ping to a host on my network. I'm using 'net-ping' gem,
declared in gemFile, and Rails Server starts OK.
Well, when i use the gem, as in another apps on Ruby, I do:
Net::Ping::External.new @name
But i
https://groups.google.com/groups/opt_out.
--
Miguel Grazziotin
Miguelgraz.com
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email
to rubyonrails-talk+unsubscr
Hi,
I need fix any bugs in a rails project. The problem is every time I change
anything in javascript I have to make
bundle exec rake rails_group=assets assets:clean RAILS_ENV=development and
then
bundle exec rake rails_group=assets assets:precompile RAILS_ENV=development
and finaly restart
Hi All,
My name is Miguel Morales, and VP of Engineering @ PaeDae.
We're currently seeking experienced senior developers to join our team.
Please see the attached job description, and send applications to:
w...@paedae.com.
You can learn more about PaeDae by visiting: http://paedae.com
Thanks
Depending on what you're trying to do there might be some java or flash
applet that will let you do that.
Theoretically you could just store the path and tell the applet to open
that file.
Your users would have to agree to install the applet and understand the
risks.
On Fri, Jan 25, 2013 at 7:50
Try this:
Cbapp::Application.routes.draw do
root :to = 'users#index'
match 'users/login' = 'users#login'
resources :users
end
Enviado desde mi iPhone
El 31/10/2012, a las 15:22, IT Coobo Internal Team li...@ruby-forum.com
escribió:
Hi everbody,
I'm new in the forum. I' studing ruby
Rafael,
For pagination I recomment kaminari.
For populating html via ajax without creating the DOM objects yourself I
recommend something like EJS: http://embeddedjs.com/
I'm not sure what the rails way would be, but that's the way I reuse bits
of HTML needed through a site.
You would basically
No need to do that, simply use rails console to interact with the DB
through Ruby/Rails.
On Wed, Jun 13, 2012 at 3:08 PM, cyber c. li...@ruby-forum.com wrote:
Hi,
I have a rails app running which provides an interface to create/update
data stored in a DB. How do i develop a cmd line
Well,
That's why you create APIs for your services.
If you're developing a mobile client for example you need to developer a
REST API.
So, I recommend you look into building a JSON API and have your command
line interact w/ it if that's the way you want to go.
But, I don't see a point to having a
Don't know what the best practice is, but the way I do it is in the model
class User ActiveRecord::Base
UserGenders = {:male = 1, :female = 2}
end
Then from code I just do if user.gender_id == User::UserGenders[:male]
On Mon, Jun 11, 2012 at 1:45 PM, Matt Martini matt.mart...@gmail.comwrote:
fixed my
problem.
Thank you in advance.
Regards,
Miguel A.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from
Hi all, I'm deploying my app on heroku for tests and have noticed
something odd.
I'm rails 3.2.3 and paperclip do handle the displaying/uploading images
process.
Everything runs smooth on my localhost but on Heroku, if I upload a
picture and the App isn't accessed for like during the night, in
I provide a form, of sorts, for creating HABTM relationships between
two other models.
Not sure if I understand your issue, but I believe you are looking at
nested resources and nested forms.
I'd like to provide a bullet list of the combined results of
validation errors and session matching
Im using Rails 3.2.3 and Ruby 1.9.3.
I want to deploy my app to heroku but am having some issues.
Basically I can push it to heroku but no tables are created, at least
all data is empty.
I can't login as it says Invalid username/password and my item list in
my index is completely empty, when in
If you're ok with production containing everything that's in your
local database you can either use heroku's db:push (https://
devcenter.heroku.com/articles/taps)
I downloaded the Windows Toolbelt and came into a problem. After just
installing the Heroku CLI, I tried to run rake routes to
I apologise for the question but I am new in RoR.
Basically I have a hotel model which has_many rooms.
I created a manager controller for administration (im redirected to it
after sucessful login)
I also created the index and managing views in the manager's View.
My managers controller has for
%= f.fields_for :hphoto do |builder| %
Since you have has_many hphotos you need fields_for :hphotos
Colin
Indeed Colin. Also, I missed an attr_accessible when I was
testing/modifying code. The :hphoto in the Hphoto model.
You've already answered 2 of my questions with positive results, many
I'm using rails 3.2.3 and am having issues with mass assignement.
I have a Hotel model and a Hphoto model (integrated with paperclip)
I have tried almost everything and still get mass-assignement error.
---
Hotel model
has_many
What's the actual error that you get?
Can't mass-assign protected attributes: hphoto
app/controllers/hotels_controller.rb:52:in `new'
app/controllers/hotels_controller.rb:52:in `create'
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the
Have you tried
attr_accessible :hphoto
rather than (or in addition to)
attr_accessible :hphoto_attributes
?
If i add to the Hphoto model:
attr_accessible :hphoto, :hphoto_attributes
the result is the same.
If I also add to the Hotel model:
attr_accessible :hphoto, :hphoto_attributes
it
you post your form view please?
Ofcourse:
%= form_for @hotel, :html = {:multipart = true} do |f| %
div class=field
(...hotel fields...)
/div
%= f.fields_for :hphoto do |builder| %
p
%= builder.label :description, Photo Description: %
%= builder.text_field :description %
im a begginer in RoR and am using rails 3.2.3 and ruby 1.8.7
This forum has helped me to progress but I'm confused by one thing.
My app is supposed to allow seaching for results depending on the check
boxes that are checked. In my case, when the user checks a determined
facility and clicks
I have a form that allows me to search a hotel by city or name and by
rating through radio buttons. It all works.
However, my hotel model has_one :facility, this facility model is
composed by several boolean fields (for example, roomservice:boolean
restaurant:boolean and so on)
The question is,
aash dhariya wrote in post #1057118:
Maybe this could be your answer:
def self.search(params)
if params
query = SELECT * FROM Hotel where city LIKE '#{params[:search]}'
OR
name LIKE '#{params[:search]}'
query+= AND rating = #{params[:rating]} if params[:rating]
Problem solved. To anyone who has the same issue, added to the new
controller:
@facility=@hotel.build_facility
And in the nested form, the correct syntax is:
%= f.fields_for :facility do |fc|%
Instead of ... :@facility do ...
--
Posted via http://www.ruby-forum.com/.
--
You received this
Newbie here, running rails 3.2.2 and ruby 1.8.7.
I have 2 models, Hotel and Facility, they both have have_one abd
belongs_to with foriegn jey created correctly.
The goal is, in a single form have displayed info. of both Hotel and
Facility. I've seen nested forms but i always get the same error.
I
Your :new action in your controller probably needs a
@hotel.build_facility
Apologies for the new thread.
If i change to what you suggested, the same error apears, but for the
@facility
ActiveModel::MassAssignmentSecurity::Error in HotelsController#create
Can't mass-assign protected
The problem lies here I think, it should possibly be fields_for
:facility do ...
Apologies for the new thread.
It now shows up in the form, the problem now is when I submit, it gives
out an error.
If i change to what you suggested, the same error apears, but for the
@facility
I posted a questionnot long ago, yet I still cannot get pass this simple
issue.
Begginer Running rails 3.2.2, Ruby 1.8.7
I have 2 models, a Hotel (created by scaffolding) and Facility (with
empty controller). I am able to set the 1-to-1 association and siplaying
fields but can't seem to insert
I'm a newbie and have searched many posts and railscast tutorials and
still cant get around this associations thing.
I have 2 models, a Hotel (created by scaffolding) and Facility.
The point is to associate a facility to a hotel, but since my facility
table has all the columns it needs with
Hi all, im using rails 3.2.2 / ruby 1.8.7 and am having a bit of a
problem googling what I need.
In my main page I am displaying all products of my MySQL DB and I want
to have a sidebar that allows me to filter the results.
Filters are by textfields and dropdown lists (also comparing start and
Hi,
I want to read data from Rails 3.1 app with PHP. I use REST with JSON for
this.
My problem is that Rails app have devise and cancan and i don't want
access to REST Services because i haven't auth previously.
Any example of this?
Thanks and sorry for my english.
--
You received this
({}, 'cvml',
'rubyonrails-talk%2bunsubscr...@googlegroups.com');.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
Luis Miguel Cabezas Granado
I.T. Informática de Sistemas
Programador PHP y Rails
ninjadevelop.wordpress.com
www.magolope.com
--
You
Hi all, im a newb and although I've googled I can't find a clear answer.
Im running: Windows 7 x64
Eclipse x64 with radrails plugin
Ruby 1.9.3p125
Rails 3.2.3
I've installed some mysql connectors and gems and DevKit and executed:
gem install mysql2
Howerver, I want to know if it is possible to
I've set up on Windows 7 Eclipse with ruby and radrails and want to use
MySQL as a database.
I've executed: gem install mysql2
And changed the database.yml
I have tried to use MySQL 5.5 and 5.1 and the error still exists.
rake aborted!
Please install the mysql adapter: `gem install
Your Gemfile lists all the gems your app uses, if you're using the
mysql2 gem you'd need
gem 'mysql2'
(If you're using an older rails version you may need to specify a
version of mysql2 that is compatible with your rails version.
Im using rails 3.2.2 na in my:
Your rails app will only use the gems specified in your Gemfile (and
their dependencies). If it's not in your Gemfile, it's not loaded,
even if it is already installed
Fred
Thank you for the explanation and time dedicated Fred
Best regards
--
Posted via http://www.ruby-forum.com/.
--
The comparison should be using ==.
If you use a single = you're assigning the variable, which would always
return true.
On Fri, Mar 2, 2012 at 3:18 PM, Christopher Jones li...@ruby-forum.comwrote:
Hi all,
I have links to the show pages for each game in my project and if the
games user_id
Hello everyone!
What would be the best way to view all attributes of an object? For
example, if a book has the attributes Title and Author, but also
belongs_to a Buyer (that have name and email), how could I easily view
the books title and author and the buyer's name and email?
If I use
also you can read
http://www.juan-capristan.net/blog/?p=173
for an explanation an guidance
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
Hi,
Estoy pasando una aplicación que trabaja con Google maps y Rails 2. Con
Google maps recojo las coordenadas X y Y en dos campos de texto y los
paso
mediante el método :with al controlador para hacer algunas operaciones.
El código es:
I have an application with RoR and Google maps and i catch
Hi,
Is there a simple way to debug specs under rails3? I've installed rvm
and I'm running ruby 1.9.2, I've tried alot of stuff to get my IDEs
debugging my specs to no avail. I can run rdebug from the command line
and debug it, but I cannot debug it from either RubyMine or NetBeans.
The last time
Hi All,
I'm trying to run a simple Activerecord query (I'm still learning) but
I'm running into a brick wall on the following error:
[4;36;1mProduct Load (0.0ms) [0m[0;1mSELECT * FROM `products`
LIMIT 1 [0m
(eval):3:in `each_hash': NULL pointer given (ArgumentError)
from
If anyone is interested, I found a solution to this problem.
See here:
http://forums.aptana.com/viewtopic.php?f=20t=7563p=27407hilit=libmysql.dll#p27407
Looks like MySQL 5.1 client library doesn't play well with Rails.
Andre
--
Posted via http://www.ruby-forum.com/.
http://www.2dconcept.com/jquery-grid-rails-plugin
maybe help you.
On Aug 7, 12:49 pm, Rob Cash rails-mailing-l...@andreas-s.net wrote:
Anyone have a more extensive yaml file for jqgrid than the one that's
shown with the example Jqgrid Demos page?
Also, I've been successful in just using the
Also seams to me he just commented it. Or is that (#=) some strange
magic? lolol
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
I noticed a funny thing, while doing this. We can not use it with an
Hash inside an array because the Hash elements will be spread all over
the array thanks to URL query brackets syntax for Arrays(if the array
index was specified in this syntax it would work, but I don't think
there is way to get
Thanks to both for the clarification, I was already guessing that
to_query was the correct choice for my scenario, but now I'm much more
confidant!
cheers
Miguel Regedor
On Mar 12, 6:27 pm, ruby...@ymail.com ruby...@ymail.com wrote:
On 12 Mar., 19:25, ruby...@ymail.com ruby...@ymail.com wrote
I like TextMate when working in Mac. And vim when working my home
Ubuntu.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to
I don't see a big advantage in storing it as a date, if you only want
to store the year why not store it as an integer? if then you need to
do some calculations you can always convert it to whatever you want.
On Feb 20, 11:56 pm, Scott Holland rails-mailing-l...@andreas-s.net
wrote:
CiriusMex
have somthing like this:
@users = [{:name = john}, {:name = miguel}]
you cannot do :
@users.each do |u| puts u.name end
because {:name = jonh} is an hash and it do not respond to method
name, although you can get the name if you do this {:name = jonh}
[:name]
So summarizing it:
a = User.new :name
What I'm trying to do:
I want to create an auto completed field for locations, but didn't
want to have the locations stored in my app. My idea is to somehow use
Google to fill that auto complete text field and then retrieve chords
using gmaps geocoding. Have anyone done something like this? does
yes, I realised I'll need to fill my data base with a bunch of
locations. It seems wikipedia has a big list of UK locations and towns
I'll have to do a parser to somehow retrieve that information. About
the plugin I would like to use jquery in my app, I found this plugin
if you have a form you can do:
f.collection_select :cabin_type_id, CabinType.find_by_status
(1).collect {|ct| ct}, :id, :name, :prompt = -- Select --
and it should mantain the selected values.
Other way (because collection_select ignore the :selected option) I
would sugest you to use a
What do you mean by I have table like this? is an ASCII table and
you want to parse it and generate the output, or you have a table like
that in your data base?
On Feb 4, 10:31 am, Shankar Ganesh rails-mailing-l...@andreas-s.net
wrote:
Hi ,
I have table like this
hi there,
@message.recipients = Volunteer.all(
:select = DISTINCT email,
:conditions = email IS NOT NULL AND email '').map(:email).join
(, )
I think one line like that would work for you.
(You don't need to use the shortcut symbol to proc if you don't like
it)
cheers
Regedor
yap, slicehost +1 =) but it depends how much you want to spent, with
slice host you have complete control of you server, but of course a
VPS is more expensive than a simple host service.
On Jan 29, 5:02 pm, Michael Kahle rails-mailing-l...@andreas-s.net
wrote:
I have multiple domains I want to
Thanks Fred I have the same problem.
How can I do that?
thanks.
On Dec 4, 3:04 am, Frederick Cheung [EMAIL PROTECTED]
wrote:
On Dec 4, 7:17 am, Jaikishan Jalan [EMAIL PROTECTED] wrote: Hello,
Not sure what is causing this. Any pointers?
cache_template_extensions has been removed. expunge
That happens to me when I edit the routes and forget to restart my server.
Ramon Tayag
On Sun, Oct 12, 2008 at 1:17 AM, lgs [EMAIL PROTECTED] wrote:
Hi all,
I'd need some help with a Subject already appeared here, anyway I re-
post with same title cause reading the old threads didn't
This doesn't exactly answer your question, but I think it may answer
your concerns. Send an activation link of some sort to their email
that they need to use to join your website.
That way, if it exists, then they get the email.
Ramon Tayag
On Sun, Oct 12, 2008 at 4:22 AM, [EMAIL PROTECTED]
Yes this should work... maybe the other have an idea.
I have a tip though (it doesn't answer your question):
separate that into two named scopes: recent and by_id so that you can
do Model.recent(id).by_id
More flexible.
Ramon Tayag
On Thu, Oct 2, 2008 at 2:34 AM, rails_in_dc [EMAIL
Checkout the cpanel error logs.
Ramon Tayag
On Wed, Oct 1, 2008 at 1:35 PM, Tam Kbe
[EMAIL PROTECTED] wrote:
Hello,
I built a web app using Ruby on Rails and it's working perfectly on
local host but once I move it to production I get this error message:
Application error
Rails
You can have, on your book table, a price_id that points to it's
latest price. Thus book.price points to its latest price, while
book.prices returns all its prices. Do a after_create on Price to set
its book's price_id to itself so that everytime you create a price
it'll set the book's
Thank you I must've been searching with the wrong terms.
Ramon Tayag
On Tue, Sep 30, 2008 at 10:47 AM, jemminger [EMAIL PROTECTED] wrote:
http://ruby-doc.org/core/classes/Net/FTP.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Hey everyone.
Is there an FTP gem/plugin that allows you to browse and manipulate an
FTP account just like AWS-S3 does with Amazon's S3 buckets?
Thanks,
Ramon Tayag
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I've never done this but I'll give my 2 cents anyway:
1) With nested routes, you are always still looking for the user - you
fetch it in the Journals controller and that's where you can evaluate
it. What you can do is fetch the current_user unless the current_user
is an admin or whatever
2)
Check their site, http://www.lokeshdhakar.com/projects/lightbox2/#how
Just make sure you html code is rendered like that and you should be fine.
Ramon Tayag
On Wed, Sep 24, 2008 at 5:46 PM, NormBoy [EMAIL PROTECTED] wrote:
Hi
I am using lightbox on my first rails project. I have got
Hi everyone,
Are all gems freezable? I've got all the gems my application requires
in my vendor folder. However, when I start it in a computer without
some of those gems installed, I get errors. The error goes away when
I install the gem in the system.
This happens to me with RedCloth, for
When you go to localhost:3000/stylesheets/your-stylesheet.css does it
come out ok?
Ramon Tayag
On Wed, Sep 24, 2008 at 1:34 AM, Martin Hawkins
[EMAIL PROTECTED] wrote:
yes and the source code of the page looks good..
On Sep 23, 5:55 pm, Shandy Nantz [EMAIL PROTECTED]
wrote:
Martin
Hey all!
Ok, weird problem with observer. Most of the time, the after_create
of UserObserver isn't called. It's like it just skips it altogether.
However, when I stop the server, add a line debugger in the
after_create block, and restart the server with the debugger option,
and try creating a
Put it in a layout (app/views/layout)
- if logged_in?
= link_to Logout #{current_user.login}, logout_path
These layouts are used when a controller is told to use them via:
layout 'layoutname'
On Sat, Sep 20, 2008 at 5:09 PM, Commander Johnson
[EMAIL PROTECTED] wrote:
Hi,
When users are
Since a city has_many pictures this tell you that the pictures table
has a city_id foreign key in it.
There isn't a nice way to do it the other way around.
On Sat, Sep 20, 2008 at 5:43 PM, Pod Caster
[EMAIL PROTECTED] wrote:
Hi, I have a basic question about how to setup my models and DB
I transferred the callback to the model, and it seems that it's the
same problem. I think the problem lies in BackgroundRB then, not
Rails or the observer. Thanks for reading my previous mail though!
Off to the backgroundrb mailing list.
On Sat, Sep 20, 2008 at 6:22 PM, Ramon Miguel M. Tayag
I would separate it... keep the roles and permission you have with
activefx's tutorial. Then your
group or channel
has_one :administrator, necessary options here
has_many :notables, necessary options here
has_many :members, :through = :memberships, other necessary options here
has_many
There are nice authentication frameworks out there.. I suggest trying
those. You can use them or study them until you understand how to
make your own.
Check out http://railsforum.com/viewtopic.php?id=14216p=1
On Thu, Sep 18, 2008 at 8:08 PM, Gilbert Gift Siima [EMAIL PROTECTED] wrote:
Hello
78 matches
Mail list logo