How to pass values to a controller

see i defined one method called campaign in the model and through a
url i am tryong to pass two parameters like user_id and campaign_id
into a method called mail_open_count. how i can pass 2 that method.

def campaign(campaign)
@campaign_id = "[#{campaign.email_campaign_content.campaign_id}] "
@user_id = "[#{campaign.user_id}] "
setup_email(campaign)
mail_template = campaign.active_email_template
template = Liquid::Template.parse(mail_template.body)
body :body => template.render(“bgcolor1” =>
mail_template.colours[:colour1],“bgcolor2” =>
mail_template.colours[:colour2],“bgcolor3” =>
mail_template.colours[:colour3])<< @user_id << @campaign_id << “”
whre is user count is defined in routel like this

map.usercount “usercount”, :controller => “campaigns”, :action =>
“save_for_email_opens”

if i wanted the parameters user_id and campaign id to store into a
table named

campaign_mail_count how can i write the method in d controller

Tony A. wrote:

see i defined one method called campaign in the model and through a
url i am tryong to pass two parameters like user_id and campaign_id
into a method called mail_open_count. how i can pass 2 that method.

def campaign(campaign)
@campaign_id = "[#{campaign.email_campaign_content.campaign_id}] "
@user_id = "[#{campaign.user_id}] "
setup_email(campaign)
mail_template = campaign.active_email_template
template = Liquid::Template.parse(mail_template.body)
body :body => template.render(“bgcolor1” =>
mail_template.colours[:colour1],“bgcolor2” =>
mail_template.colours[:colour2],“bgcolor3” =>
mail_template.colours[:colour3])<< @user_id << @campaign_id << “”
whre is user count is defined in routel like this

map.usercount “usercount”, :controller => “campaigns”, :action =>
“save_for_email_opens”

if i wanted the parameters user_id and campaign id to store into a
table named

campaign_mail_count how can i write the method in d controller

Hi,

You can try do it like to:
link_to “hello”, campain_path(:user_is => 4, :campain_id => 2)

Greg

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs