0
votes
0answers
6 views

Using RubyCas-server and Rubycas Client For SSO

I have to do SSO using CAS. I have install RubyCas-server and and RubyCas Client. In my ruby on rails website I am using devise. I am here with my code for rubycas client. gem install gem ...
-2
votes
0answers
38 views

How to refactor this piece of code

I'm new to ruby on rails, on this project I'm using ruby 2.0 and rails 3.0 I would like to know if this piece of code can be refactored, as it is unless params["ot_code"].nil? ots = ...
0
votes
0answers
7 views

resque @queue variable returns nil during the test environment but within development it works

In development: 1.9.3p429 :001 > Auction::RiskProfile.instance_variable_get(:@queue) => :low_priority 1.9.3p429 :002 > Resque.queue_from_class(Auction::RiskProfile) => :low_priority 1.9.3p429 ...
0
votes
1answer
16 views

How to access hidden_field in controller in Ruby on rails

Question: How to access hidden field value post_id from file view/comments/_comment.html.erb and use it in controllers/dashboards_controller.rb? - there are 2 controllers - dashboard and comments, ...
2
votes
1answer
26 views

how to call method in one application from another application in ruby on rails

I want to call the method and get the response in my application from another application in Ruby on Rails technology, but here cross site scripting problem is there. so, i can i resolve this issue ...
0
votes
2answers
28 views

How to show user.name associated with timesheets?

I am having issues with an app displaying the user.name in a timesheets index (shows all timesheets, not just current user timesheets) User model: # Table name: timesheets # # id :integer ...
0
votes
0answers
25 views

Windows or Unix commands from within rails

I need to run windows or unix tools/commands from within Rails controller. e.g. I need to run usp.exe in windows and pipe the output to a file called usb_results.csv using following command : ...
0
votes
2answers
18 views

A blank in the URI works in production but fails in development

I have the following code which works in production: redirect_to "/mycontroller/index.html#&panel1-2;?error=Invalid Member ID and/or Date of Birth" In development(using Webrick), I am getting the ...
0
votes
2answers
31 views

Rails - Customize model validation error messages but without a database

I have a model that validates a form but it does not inherit from ActiveRecord....it does not have a database I am validating certain fields in the model but i want to have custom validation ...
1
vote
2answers
33 views

Ruby on Rails - routing error, goes to “show” instead of “index”

I have a basic homepage with a link that I would like to go to businesses/index.html.erb <%= link_to("Go to businesses index page", {:controller=>"businesses", :action =>"index"}) %> ...
0
votes
1answer
56 views

Rails 3 some features not working

In rails 4.0 I use to get controller name like this: <% if controller.controller_name == "something" %> The code is in view and controller function is in actionview helper. Supposedly it is ...
0
votes
2answers
52 views

Trying to install Ruby 2.0.0 gives me “rvm: command not found” on Linux

I have discovered an issue/bug with the Ruby RVM so lets break down this issue bit by bit and hopefully find a resolution to this problem. So let's change this post to: UPDATING REDHAT LINUX SERVER'S ...
1
vote
3answers
43 views

Rails how to improve if record exists?

I have this model: class Device < ActiveRecord::Base has_many :events def last_event events.last end end As you can see, I have a method to get the last event for the device. Now, ...
1
vote
0answers
25 views

Login via github hangs if accessed by domain

I have an app where a user can login using github. When I log in, the app hangs for about one minute. This is the log Started GET "/" for 177.97.171.165 at 2013-08-11 15:26:01 +0000 Started GET ...
0
votes
1answer
49 views

How to handle special characters like “ ’ ” when fetched from DB

Actually, i have an entry in my db of title "You’re Accepted to College, Now What: Deciding Upon...". So when user types "you'are accepted...." it doesn't match with the above because of the special ...
0
votes
3answers
51 views

How to duplicate a record in Rails except for one attribute?

In my Rails application I have a method that duplicates an invoice including its items. class Invoice < ActiveRecord::Base def duplicate dup.tap do |new_invoice| new_invoice.date = ...
0
votes
1answer
27 views

Show two models (Images and Treatments) in one table

I have two models that belong to patient Images and Treatments. On the show patients page i would like to show both in one table. So far i have a treatments table: <% @treatments.each do |f| %> ...
1
vote
3answers
42 views

ruby on rails - undefined method valid?

im following ryan bates screen cast on how http://railscasts.com/episodes/219-active-model on how to validate a form without a database but i keep getting an undefined method valid? heres my ...
0
votes
1answer
27 views

Carrierwave - How to reference a model's image from a different model

I have a User model and a Project model. The User model has a PhotoUploader as a carrierwave uploader, and the Project model has a LogoUploader as a carrierwave uploader. I also have a Poster model ...
0
votes
2answers
34 views

Using Rails find_or_initialize_by_email, how to determine if record if found or initialized?

In one of my controllers, I'm doing: user = User.find_or_initialize_by_email(@omniauth['info']['email']) I then need to know if the records was found or initialized. I had tried this: if user ...
-1
votes
2answers
38 views

Programmatically interact w/ a webpage?

Is there a way through ruby or the command line that I can choose a value from a drop-down box on a webpage and then press a submit button? I want to download the html of a webpage, but every version ...
-1
votes
1answer
23 views

I have an error when starting redmine from cPanel

Please, help me! I can't solve this issue for a long period of time. This is my first redmine installation! The following errors I get in my mongrel.log file when starting redmine from cPanel: ** ...
0
votes
1answer
52 views

rails cannot load such file — mysql2/mysql2 (LoadError)

I am newbie to ruby on rails i could not find the solution for this error: rails s /usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require': cannot load such file -- mysql2/mysql2 ...
0
votes
0answers
17 views

Tumblr client gem - list of methods

I can't seem to find a good list of methods that I can use with tumblr_client gem. Anyone know where I might find this? There are bits and pieces around but not a comprehensive list. For example I ...
0
votes
1answer
50 views

Trying to check a String number against Range

I have a situation where my data is a number, and is saved as a String. I have a Range that I want to check the String against. The item in the Range is an Integer. How can I do this? Below is my ...
0
votes
1answer
37 views

Rails - two attributes one input field - Whats the Syntax?

I need this html output from my form <input class="text valid" id="contacts_custom_field_phone_number_50754" name="contacts[custom_field][phone_number_50754]" size="30" type="text"> this is ...
0
votes
1answer
34 views

How can I include a field that is not part of the group clause in a ActiveRecord query?

(Ruby 1.9.3-p429; Rails 3.0.6) Recent changes to the way we queue our tests have rendered our last_ids scope: last_ids = tests.where('end_time != 0'). group(:condition1, :condition2, ...
0
votes
2answers
44 views

How to remove blanks from Rails' simple_format() output?

I am using Rails' simple_format() to output addresses from my database like this: <%= simple_format(@person.address) %> As I result I get this markup in my Safari browser: <p> "John ...
1
vote
1answer
35 views

Iterate through to create a hash of hashes

As the final result I need a hash like: {items: {lorem: val1, dolor: val2}, {lorem: val1, dolor: val2}...} e.g. a hash of hashes. Put the problem is it should be created from iteration like this: ...
0
votes
1answer
25 views

How do I get Rails' field syntax to match HTML rendered name?

I need my Rails code to render one of its form fields like this: contacts[:custom_field][phone_number] I've tried all sorts of things to get this to work in my template file: :custom_field=> ...

1 2 3 4 5 356
15 30 50 per page