Has anyone managed to get HolyGrail (http://github.com/mynyml/holygrail) to work with RSpec. It is currently TestCase centric, but I was hoping for an easy way to extend into RSpec/Rails
Hello, World..
I'm currently building a website for an awesome youth church we run (shameless plug!)..
Anywho at the moment we have a static countdown page http://mybase.co , and were having a massive launch this weekend and the site needs to go live when we launch,
it's a rails app..
How would you recommend scheduling it going live?
having a cron job and an apache a2en?
or is there a better way?
Thanks
Daniel
I have two applications: c++ service and a RoR web server (they are both running at same VPS)
I need to "send" some variables (and then do something with them) from each other. For exaple, i'm looking for something like this:
// my C++ sample
void SendMessage(string message) {
SendTo("127.0.0.1", message);
}
void GetMessage(string message) {
if (message == "stop")
SendMessage("success");
}
# Ruby sample
# application_controller.rb
def stop
@m = Messager.new
@m.send("stop")
end
I have never used it before, and i even don't know which technology should i search and learn.
I have installed RubyonRails in Ubuntu 10.04:
$ sudo gem install rails
$ echo $PATH prints:
/home/koningbaard/.gem/ruby/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
But when I run $ rails --version, BASH tells me that rails is not currenly installed, and that I can install it with apt-get, which I don't want (I want it installed through gem).
Can anyone help me where I can find it and how I can add it to my PATH? Thanks
Hi Everyone,
A follow on from this questions:
http://stackoverflow.com/questions/3032598/rails-created-at-on-display-if-today
Is it possible to output the word TODAY rather than the date when using the following helper?
def created_today k
k.created_at if k.created_at.to_date == Date.today
end
<%=h created_today(k) %>
Thanks,
Danny
In my rails app I have defined the routes so users can access records like http://mydomain.com/qwe2
But if they type a wrong "qwe2" they get a 500 page. I think a 404 would be more appropriate.
How can I change the error page that is shown? Thanks
I am working with Rails 2.2.
The required behaviour is as follows:
I have a link(with a ajax link embedded)
xyz.com/admin#page1
When I go to the above page, I should be redirected to the login page, if I am not logged in.
After I log in, I should be taken back to
xyz.com/admin#page1
For this I need to store the url in session when I visit any page.
The problem is that when I do request.uri, I get
xyz.com/admin
But I want to store
xyz.com/admin#page1
Regards,
Pankaj
Rails defines a bunch of magic with named routes that make helpers for your routes. Sometimes, especially with nested routes, it can get a little confusing to keep track of what URL you'll get for a given route helper method call. Is it possible to, using the Ruby console, see what link a given helper function will generate? For example, given a named helper like post_path(post) I want to see what URL is generated.
When I execute a Rails unit test from the command line (as suggested here) such as
ruby unit/test_model.rb
...I get this error:
No such file or directory - .../test/config/database.yml (Errno::ENOENT)
Am I doing something wrong? Or is there a workaround?
How do I configure RubyonRails to output standard HTML code instead of XHTML when using helpers (form, javascript, css, etc.)?
I don't want to have the slash at the end:
<input name="email" type="text" />
[Rails] Where to put this code?
I have a user1 and when another registered user2 sees the profile of user1, has some buttons on it: ['add as friend', 'give me your number', 'give me your email', 'ask her out', 'view photos']. The 1,2,3,4 are POST, with AJAX. Now, i have to make a new controller named 'ProfileActionsController' or i should put this code in the 'UsersController'?
or maybe a another posiibility? thanks ;)
I've noticed that pagination gems like mislav-will_paginate are quite popular. Is this because Rails does not have a built-in pagination solution or because the built-in solution is not very good?
I need to push my rails code into stating environment from github. And then deploy this app into engineyard in staging environment. Could some please give me step I need follow
Background Job gets mentioned a lot but all the tutorials I've seen seem to indicate that its for queuing jobs which are created by some external event such as a user clicking "Send mail".
But what about when you have code that needs to scheduled to run every 30 seconds to listen for new messages from twitter?
Normally rake is recommended for set in stone schedules but it inst so efficient for frequent jobs as it has to to load the entire rails app each time.
Can anyone recommend anything for this situation?
I'm using clearance (http://wiki.github.com/thoughtbot/clearance) for authentication in my rails app. But I'm trying to figure out how to grab the user's ID in a view after logging in.
Any ideas?
The name pretty much says it all. Does anyone know how to accomplish functional testing when you are not using migrations in Rails? I'd be open to any advice or third party libraries (if there are any). I thought of creating my own plugin to address this but it seems like a pretty big task and would rather not do this unless necessary.
Thanks in advance.
The following situation:
I have a poi model, which has many pictures (1:n). I want to recalculate the counter_cache column, because the values are inconsistent.
I've tried to iterate within ruby over each record, but this takes much too long and quits sometimes with some "segmentation fault" bugs.
So i wonder, if its possible to do this with a raw sql query?
I am on the rubyonrails application and trying to embed the code for js , added the whole code for embedding in Text box , But when i copy paste in other blogs where embed is poss , i am not getting the full js work , the code is given below
<%= text_field_tag "text","
script src=\"/public/javascripts/calendarview.js\"
script src=\"/public/javascripts/calendarview_init.js\"
link rel=\"stylesheet\" href=\"/public/stylesheets/calendarview.css\"
link rel=\"stylesheet\" href=\"/public/stylesheets/calendarview_init.css\"
",:size = 40
%
I have just removed < for let it be seen in the coding window
PLease help if poss
List item
I'm iteration over records and want to create the toggle-options for records but I can't replace the div-id with the records:
<% for bill in @bills %
<% tmp = "test"%
<%= link_to '» now','#', :onclick = '$("#{tmp}").toggle();' %
Instead of getting:
» now
I'm getting:
» now
So he isn't evaluation the ruby variable in the string. How can I do this?
Thanks for your help and I'm new in jquerry.
Is it normal for my test suite to take 5 seconds just to launch? Even when running an empty suite it still takes this long. Is it because it's firing up a new instance of railson each run? If so, is there anyway to keep it persistent?
I'm using Test::Unit with Shoulda.
Hi
I'm wondering how to implement highlighting of changes to user edited articles on a wiki style rails project. Since articles may be fairly lengthy I'd ideally like strikethrough and highlighting, similar to github and wikipedia for example. Despite searching around the net I've not really come up with much, apart from instiki which is a complete wiki application.
Thanks in advance for any advice.
I am trying to get put out a simple site, which would pool the database every few seconds and update the information on the page dynamicly, when theres something new inserted.
I am farily new to ruby, but I understand the whole concept of RJS, link_to_function and soforth. The question is, what is the best way how to implement some kind of simple loop, which would run after the page is loaded and update the DOM if there is something new to display.
Thanks in advance for any tips!
Hi everyone,
SELECT * FROM jobs WHERE (SELECT DISTINCT jobs.* FROM jobs, job_requests WHERE (jobs.user_id = 1) OR (job_requests.user_id = 1 AND job_requests.job_id = jobs.id))
This sql gives me Mysql::Error: Operand should contain 1 column(s). If i execute the select from the where clause it works SELECT DISTINCT jobs.* FROM jobs, job_requests WHERE (jobs.user_id = 1) OR (job_requests.user_id = 1 AND job_requests.job_id = jobs.id)
Could somebody explain me why? This query is generated by rails activerecord so the main select is needed.
I'm using Rails 2.3.2 and using Paperclip to upload photos. I'm also using a slightly customized subdomain_accounts.rb to set some account-specific variables. My question is this:
How can I set the bucket used in Paperclip to be dependent on the current account? Since this looks to be a model attribute set up early on, how can I override it later? Thanks.